/// <summary> /// 从文件系统加载文本文件 /// </summary> /// <param name="file"></param> /// <returns></returns> public IEnumerator LoadTextFileAsync(string file) { string url = null; WWW www = null; com.QH.QPGame.GameUtils.Logger.Res.Log("load text:" + file); #if !UNITY_EDITOR || TEST_AB if (downloadedABs.Contains(file)) { url = GameHelper.GetDownloadPath(true) + file; www = new WWW(url); yield return(www); } #endif if (www == null || !string.IsNullOrEmpty(www.error)) { url = GameHelper.GetInternalPath(true) + file; www = new WWW(url); yield return(www); if (!string.IsNullOrEmpty(www.error)) { com.QH.QPGame.GameUtils.Logger.Res.Log("get file text error. Error:" + www.error + " File:" + file); yield break; } } cachedFiles[file] = www.text; }
public bool Initialize() { com.QH.QPGame.GameUtils.Logger.Res.Log("Res System Init"); Reset(); #if !UNITY_EDITOR || TEST_AB if (abMgr == null) { abMgr = new LOAssetManager[2]; for (int i = 0; i < 2; i++) { abMgr[i] = gameObject.AddComponent <LOAssetManager>(); abMgr[i].URI = i == 0 ? GameHelper.GetInternalPath(true) : GameHelper.GetDownloadPath(true); } } #endif StartCoroutine(InternalInit()); return(true); }
public bool Initialize() { Account = null; Password = null; MAC = ""; Host = ""; Port = 0; BackStorgeUrl = ""; CDN = ""; OfficeSiteUrl = ""; EnterGameID = 0; EnterRoomID = 0; UserInfo = null; PrivateKey = ""; TempPassword = null; SavePassword = false; TempNickName = ""; MAC = MacAddress.GetMacAddress(); Host = GameApp.Options.ServerHost; Port = (uint)GameApp.Options.ServerPort; ForceSingleton = GameApp.Options.ForceSingleton; DownloadPath = GameHelper.GetDownloadPath(false); Version = GameApp.Options.Version; InstallVersion = ""; #if !UNITY_EDITOR && UNITY_STANDALONE_WIN ProcessCommandline(); #endif return(true); }
void Awake() { downloadPath = GameHelper.GetDownloadPath(false); downloadLoadPath = GameHelper.GetDownloadPath(); }