public LauguageData(string filePath, LauguageType defaultLau = LauguageType.China) { this.filepath = filePath; _type = LauguageType.NULL; _dic = new Dictionary <string, string>(); SetLauguageType(defaultLau); }
public void SetLauguageType(LauguageType type) { if (_type == type) { return; } _type = type; if (System.IO.File.Exists(filepath)) { using (System.IO.StreamReader sr = new System.IO.StreamReader(filepath)) { string str = sr.ReadToEnd(); writeToDic(str); } } else { TextAsset ta = Resources.Load <TextAsset>("lauguageConfig"); if (ta != null) { writeToDic(ta.text); } else { Debug.Log("not found"); } } }
public void SetLauguageType(LauguageType type, System.Action whenDone = null) { if (_type == type) { return; } _type = type; LoadConfig(whenDone); #region//在安卓路径下 这个有问题 采用www /* * if (System.IO.File.Exists(filepath)) * { * using (System.IO.StreamReader sr = new System.IO.StreamReader(filepath)) * { * string str = sr.ReadToEnd(); * writeToDic(str); * } * } * else * { * TextAsset ta = Resources.Load<TextAsset>("bb"); * if (ta != null) * { * Debug.Log("ta txt = "+ta.text); * writeToDic(ta.text); * } * else * Debug.LogError("not found"); * } */ #endregion }
public void ChangeLauguage(LauguageType type) { if (type == curLauguage) { return; } SetLauguage(type); lauList.ForEach((x) => { x.InitUIText(); }); }
public void ChangeLauguage(LauguageType type, System.Action del = null) { if (type == curLauguage) { return; } SetLauguage(type, () => { lauList.ForEach((x) => { x.InitUIText(); }); if (del != null) { del(); } }); Debug.Log("change lauguage == " + type); }
public void SetLauguage(LauguageType type, System.Action whenDone = null) { data.SetLauguageType(type, whenDone); }
public void SetLauguage(LauguageType type) { data.SetLauguageType(type); }