private void LoadLocalizeType() { _listLocalizeType.Clear(); ResourcesManager.Asset tAsset = new ResourcesManager.Asset("TextScript/LocalizationType", ResourcesManager.AssetType.Bytes, ResourcesManager.AssetPath.Resources); ResourcesManager.LoadAsset(tAsset, (ResourcesManager.Asset asset) => { byte[] bytes = asset._bytes; FileHandler handler = new FileHandler(bytes); string str; while (!string.IsNullOrEmpty(str = handler.ReadLine())) { _listLocalizeType.Add(str.Trim()); } LoadLocalizeString(); }, (ResourcesManager.Asset asset) => { }); }
private void LoadLocalizeString() { _dicLocalizeString.Clear(); string url = string.Format("TextScript/{0}/Localization", _listLocalizeType[_localizeTypeIndex]); ResourcesManager.Asset tAsset = new ResourcesManager.Asset(url, ResourcesManager.AssetType.Bytes, ResourcesManager.AssetPath.Resources); ResourcesManager.LoadAsset(tAsset, (ResourcesManager.Asset asset) => { byte[] bytes = asset._bytes; FileHandler handler = new FileHandler(bytes); string str; while (!string.IsNullOrEmpty(str = handler.ReadLine())) { string[] strs = str.Split('='); string key = strs[0].Trim(); if (key.Substring(0, 2).Equals("//")) { continue; } key = key.Substring(1, key.Length - 2); string value = strs[1].Trim(); value = value.Substring(1, value.Length - 3); if (_dicLocalizeString.ContainsKey(key)) { _dicLocalizeString[key] = value; } else { _dicLocalizeString.Add(key, value); } if (null != OnLocalize) { OnLocalize.Invoke(); } } }, (ResourcesManager.Asset asset) => { }); }