| Core/ResModule/AssetBundle/AssetBundleUtility.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/AssetVersion/DownLoadAndDiscompressTask.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Core/ResModule/AssetBundle/AssetBundleUtility.cs
@@ -42,6 +42,51 @@ assetBundle = null; } public void ReInitBuiltInAsset() { var path = AssetVersionUtility.GetBuiltInAssetFilePath("builtin_assetbundle"); var assetBundle = AssetBundle.LoadFromFile(path); if (assetBundle == null) { DebugEx.LogError("AssetBundleManifest的包文件为空或者加载出错."); } var manifest = assetBundle.LoadAsset<AssetBundleManifest>(ResourcesPath.AssetDependentFileAssetName); if (manifest == null) { DebugEx.LogError("AssetBundleManifest文件为空或者加载出错."); } for (int i = m_AssetBundleInfoList.Count - 1; i >= 0; i--) { var item = m_AssetBundleInfoList[i]; if (item.name.Contains("builtin")) { m_AssetBundleInfoList.Remove(item); } } foreach (var item in m_AssetBundleDict.Keys) { if (item.Contains("builtin")) { m_AssetBundleDict.Remove(item); } } var bundles = manifest.GetAllAssetBundles(); foreach (var bundle in bundles) { var dependenices = manifest.GetAllDependencies(bundle); var hash = manifest.GetAssetBundleHash(bundle); var assetBundleInfo = new AssetBundleInfo(bundle, hash, dependenices); m_AssetBundleInfoList.Add(assetBundleInfo); } assetBundle.Unload(true); assetBundle = null; } public IEnumerator Initialize() { yield return StartCoroutine(Co_LoadMainfestFile("audio")); System/AssetVersion/DownLoadAndDiscompressTask.cs
@@ -18,17 +18,16 @@ public int totalCount { get; private set; } public int okCount { get; private set; } public bool restartApp { get; private set; } public bool reinitedBuiltInAsset { get; private set; } public event Action<Step> downLoadStepChangeEvent; Action downLoadOkCallBack; Step m_Step = Step.None; public Step step { public Step step { get { return m_Step; } set { set { if (m_Step != value) { m_Step = value; @@ -50,6 +49,7 @@ okCount = 0; step = Step.DownLoadPrepared; restartApp = false; reinitedBuiltInAsset = false; totalSize = 0; for (int i = 0; i < tasks.Count; i++) @@ -62,6 +62,11 @@ restartApp = true; } #endif if (!reinitedBuiltInAsset && task.relativePath.Contains("builtin")) { reinitedBuiltInAsset = true; } } if (totalSize > BYTE_PER_MILLIONBYTE) @@ -121,6 +126,11 @@ { SDKUtility.Instance.RestartApp(); } if (reinitedBuiltInAsset) { AssetBundleUtility.Instance.ReInitBuiltInAsset(); } } private void OnFileDownLoadCompleted(bool _ok, AssetVersion _assetVersion)