public static void Test2Process(int a, int b) { DebugUtils.Log(InfoType.Info, string.Format("Test2Process {0} {1}", a, b)); }
public static void TestEnd() { DebugUtils.Log(InfoType.Info, "TestEnd"); }
public static void Test1Process(string a) { DebugUtils.Log(InfoType.Info, string.Format("Test1Process {0} ", a)); }
public static void InsertTestEnd() { DebugUtils.Log(InfoType.Info, "InsertTestEnd"); }
public static void TestBegin() { DebugUtils.Log(InfoType.Info, "TestBegin"); }
public static void OnCompletion() { DebugUtils.Log(InfoType.Info, string.Format("OnCompletion")); }
public static void InsertTest() { mCounter++; DebugUtils.Log(InfoType.Info, "InsertTest : " + mCounter); }
public static void Test4End() { DebugUtils.Log(InfoType.Info, string.Format("Test4End ")); }
public static void Test3(string a, int b, bool c) { DebugUtils.Log(InfoType.Info, string.Format("Test3 {0} {1} {2}", a, b, c)); }
private IEnumerator DownloadAssetBundles() { using (UnityWebRequest req = UnityWebRequest.Get(SystemConfig.GetFilePath("/", AssetbundleInfoFile, false))) { UnityWebRequestAsyncOperation reqBin = req.SendWebRequest(); yield return(reqBin); if (req.isNetworkError || req.isHttpError) { // 重新下载 DebugUtils.Log(InfoType.Error, string.Format("DiffAssets : {0}", SystemConfig.GetFilePath("/", AssetbundleInfoFile, false))); } else { if (req.downloadHandler.isDone) { GameDataManager.ChangeDir(SystemConfig.GameDataDir); // 本地获取并解析, 全部拷贝一份 List <AssetbundleUpdateData> oldDataInfos = AssetbundleUpdateData.Select((item) => { return(item.Name != null); }); // 清理不存在本地文件的实例 int notExistsCount = oldDataInfos.RemoveAll((item) => { return(IsFileExist(item)); }); DebugUtils.Log(InfoType.Warning, string.Format("notExistsCount {0}", notExistsCount)); // 再释放 GameDataManager.ClearFileData(AssetbundleInfoFile); DebugUtils.Assert(AssetbundleUpdateData.IsOriginNull(), "wrong clear"); // 保存到 临时目录 string text = req.downloadHandler.text; File.WriteAllText(SystemConfig.LocalTempDir + "/" + AssetbundleInfoFile, text); // 切换到 临时目录 GameDataManager.ChangeDir(SystemConfig.LocalTempDir); // 全部拷贝一份 List <AssetbundleUpdateData> newDataInfos = AssetbundleUpdateData.Select((item) => { return(item.Name != null); }); // 释放 GameDataManager.ClearFileData(AssetbundleInfoFile); DebugUtils.Assert(AssetbundleUpdateData.IsOriginNull(), "wrong clear"); GameDataManager.ChangeDir(SystemConfig.GameDataDir); // 处理 List <AssetbundleUpdateData> addAssets = DiffAssetBundles(oldDataInfos, newDataInfos); mDownloadSize = 0; mTotalSize = 0; mTotalCount = 0; mDownloadCount = 0; mAssetbunlesWebRequest.Clear(); mTotalCount = addAssets.Count; addAssets.ForEach((item) => { mTotalSize += item.FileSize; }); foreach (AssetbundleUpdateData info in addAssets) { string url = SystemConfig.GetRemotePathInAssetbundle(info.Name); UnityWebRequest abReq = UnityWebRequest.Get(url); AddReq(abReq); UnityWebRequestAsyncOperation reqAssetbundleReq = abReq.SendWebRequest(); reqAssetbundleReq.completed += (AsyncOperation operation) => { if (abReq.isNetworkError || abReq.isHttpError) { // 重新下载 DebugUtils.Log(InfoType.Error, "wrong req: " + url); } else { AddDownloadCount(); byte[] data = abReq.downloadHandler.data; AddDownloadSize(data.Length); SaveLocalAssetBundle(info.Name, data); // 下载进度 SizeProgress?.Invoke(SizePercent); CountProgress?.Invoke(mDownloadCount, mTotalCount); } RemoveReq(abReq); abReq.Dispose(); }; } // 开始进度 SizeProgress?.Invoke(SizePercent); while (mAssetbunlesWebRequest.Count > 0) { yield return(Wait); } Finished?.Invoke(mVersionData.InfoTips); } } } }
private static void HandleHeartEvent(NetworkPacket packet) { DebugUtils.Log(InfoType.Info, "CommandId: " + packet.CommandID); }
public static void SetFishing(bool isFishing) { // bFinshing = isFishing; DebugUtils.Log(InfoType.Info, "-------------------------------------------------------------"); }