From b0026ed4e12ffb5672feaf511f74e7aae3ec023c Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期五, 26 十月 2018 09:37:02 +0800
Subject: [PATCH] 4334 【前端】随包资源支持热更

---
 Core/ResModule/AssetBundle/AssetBundleUtility.cs |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/Core/ResModule/AssetBundle/AssetBundleUtility.cs b/Core/ResModule/AssetBundle/AssetBundleUtility.cs
index 9407f90..92f0e3c 100644
--- a/Core/ResModule/AssetBundle/AssetBundleUtility.cs
+++ b/Core/ResModule/AssetBundle/AssetBundleUtility.cs
@@ -14,6 +14,34 @@
     public bool initialized { get; private set; }
     public bool initializedUIAssetBundle { get; private set; }
 
+    public void InitBuiltInAsset()
+    {
+        var path = AssetVersionUtility.GetAssetFilePath("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鏂囦欢涓虹┖鎴栬�呭姞杞藉嚭閿�.");
+        }
+
+        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"));

--
Gitblit v1.8.0