当前位置: 首页 > news >正文

番禺建设网站公司哪家好世界最新新闻

番禺建设网站公司哪家好,世界最新新闻,行业门户网站如何做,网站架构演变流程有些单机项目开发的时候没有做本地文本配置文件,全部写死在场景的对象上面,简单记录一下怎么提取场景里面的文本并且写入到配置文件里面using System.Collections.Generic;using System.IO;using TMPro;using UnityEditor;using UnityEngine;using Unity…

有些单机项目开发的时候没有做本地文本配置文件,全部写死在场景的对象上面,简单记录一下怎么提取场景里面的文本并且写入到配置文件里面

using System.Collections.Generic;

using System.IO;

using TMPro;

using UnityEditor;

using UnityEngine;

using UnityEngine.UI;

public class Test : MonoBehaviour

{

static List<string> txtArray = new List<string>();

static string labelStr = "_config_Label_";

[MenuItem("Tools/ÌáÈ¡Îı¾")]

static void GetAllSceneObjectsWithInactive()

{

ReadFile();

var allGos = Resources.FindObjectsOfTypeAll(typeof(GameObject));

var previousSelection = Selection.objects;

Selection.objects = allGos;

var selectedTransforms = Selection.GetTransforms(SelectionMode.Editable | SelectionMode.ExcludePrefab);

Selection.objects = previousSelection;

int index = 0;

foreach (var trans in selectedTransforms)

{

Text text = trans.GetComponent<Text>();

string textContent = "";

if (text == null)

{

TextMeshProUGUI textMeshPro = trans.GetComponent<TextMeshProUGUI>();

if (textMeshPro != null)

{

textContent = textMeshPro.text;

}

}

else

{

textContent = text.text;

}

if (!string.IsNullOrEmpty(textContent)&&!trans.name.Contains("LiberationSans SDF Atlas"))

{

UILanguageText uILanguageText= trans.gameObject.AddComponent<UILanguageText>();

index = index + 1;

string content = "";

if (textContent.Contains("\n"))

{

string[] temp = textContent.Split('\n');

for (int i = 0; i < temp.Length; i++)

{

if (i< temp.Length -1)

{

content = content + temp[i] + "\\n";

}

else

{

content = content + temp[i];

}

}

}

else

{

content = textContent;

}

string languageKey = string.Format("{0}{1}{2}", trans.name, labelStr, index);

uILanguageText.languageKey = languageKey;

txtArray.Add(string.Format("{0},{1}", languageKey, content));

Debug.Log(trans.name+":::"+ textContent);

}

}

WriteFile();

Debug.Log("ÌáÈ¡½áÊø");

}

static void WriteFile()

{

File.WriteAllLines(Application.dataPath + "/Resources/Language/CN.txt", txtArray);

}

static void ReadFile()

{

txtArray.Clear();

string[] strs = File.ReadAllLines(Application.dataPath + "/Resources/Language/CN.txt");

for (int i = 0; i < strs.Length; i++)

{

txtArray.Add(strs[i]);

}

}

}

http://www.shuangfujiaoyu.com/news/29167.html

相关文章:

  • 外贸soho建网站绍兴seo优化
  • 国外设计网站图片优化方案英语
  • 百度地图开发网站网站怎么优化搜索
  • 佛山品牌网站设计制作微博指数
  • 网站开发就业前景搜索引擎营销怎么做
  • 自建淘宝客APP网站模板友链交换网站
  • 特色网站模板友链交易
  • 呼和浩特免费制作网站手机百度助手
  • 国外域名注册商排名深圳市企业网站seo营销工具
  • 移动端适配seo在线优化工具 si
  • 兰州城关区建设局网站最近一周的新闻热点事件
  • 山东省住房和城乡建设厅服务网站公关公司一般收费标准
  • wordpress分级访问权限常用的seo查询工具有哪些
  • 公司对网站排名如何做绩效海南seo顾问服务
  • 推广网站有哪些方式珠海网站建设优化
  • 网站建设的培训的感受哪些网站有友情链接
  • 秦皇岛商联网络科技有限公司百度seo优化排名如何
  • 做瞹瞹瞹免费网站宁波seo外包推广渠道
  • 网站title如何修改中山口碑seo推广
  • php做购物网站八大营销方式有哪几种
  • 如何设置自己的网站谷歌全球营销
  • 沧州做英文网站哪家公司好学seo推广
  • 网站友情链接怎么弄专门看网站的浏览器
  • wordpress 哪些网站关于搜索引擎的搜索技巧
  • 网站产品标题怎么写著名的网络营销案例
  • 学做效果图网站网页制作用什么软件做
  • java 建设一个网站百度霸屏培训
  • 做网站 商标分类自己做网站建设
  • 做网站开发的经营范围如何建网站要什么条件
  • 龙岗 网站建设免费创建个人博客网站