当前位置: 首页 > 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.15wanjia.com/news/43126.html

相关文章:

  • 怎样做校园网站百度热议怎么上首页
  • 用自己的照片做头像的网站生成关键词的软件
  • 免费网站建设步骤实时排名软件
  • 石家庄企业商城版网站建设上海网络推广优化公司
  • 河南省网站建设意见博客优化网站seo怎么写
  • 建立购物网站搭建网站步骤
  • 如何写代码做网站seo技术306
  • 云南网站seo外包企业邮箱入口
  • wordpress连接济南seo网站排名关键词优化
  • 自助网站系统厦门百度seo
  • 济南做网站推广有哪些公司淘宝代运营
  • 个人网站做重定向图片seo团队
  • 百度口碑seo关键词排名优化品牌
  • 视频网站开发文档正规引流推广公司
  • 中国风网站设计小红书关键词检测
  • 建设网站技术公司谷歌seo详细教学
  • 怎么用dwcs6做网站设计谷歌chrome浏览器
  • 怎么做跨境电商网站网站推广策划书模板
  • delphi intraweb做网站推广商
  • 适合大学生做兼职的网站有哪些域名申请
  • 织梦做网站简单吗seo营销外包
  • 有什么网站学做标书的百度排名服务
  • 怎么做网站用户可以发表文章百度seo优化按年收费
  • 郑州汉狮哪家做网站好专业seo排名优化费用
  • 网站开发工程师助理网站如何优化
  • 建立一个个人介绍的网站种子搜索引擎 磁力天堂
  • 南昌专业网站设计2023年第三波新冠9月
  • 企业免费招聘网站整合营销策划方案
  • 做网站首先必须切割图片吗百度手机助手app安卓版官方下载
  • app与微网站的区别是什么seo 是什么