少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-26 b0026ed4e12ffb5672feaf511f74e7aae3ec023c
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"));