dezhou_client/wb_unity_pro/Assets/Scripts/LuaHelper/LuaUIHelperText.cs

34 lines
843 B
C#
Raw Normal View History

2025-12-17 21:08:27 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LuaUIHelperText : MonoBehaviour
{
public TextAsset[] texts;
Dictionary<string, string> dicText = new Dictionary<string, string>();
// Start is called before the first frame update
void Start()
{
for (int i = 0; i < texts.Length; i++)
{
if (dicText.ContainsKey(texts[i].name))
{
continue;
}
dicText.Add(texts[i].name, texts[i].text);
}
}
public string[] GetText(string strKey, string s)
{
if (dicText.ContainsKey(strKey))
{
string strTemp = dicText[strKey].Replace("\n", "");
strTemp = strTemp.Replace("\r", "");
return strTemp.Split(s);
}
return null;
}
}