Пример #1
0
        public void Initialize()
        {
            LogUtil.LogGreen(GameConfig.AssetPath("StreamingAssets"));
            AssetBundle assetBundle = AssetBundle.LoadFromFile(GameConfig.AssetPath("StreamingAssets"));

            manifest = (AssetBundleManifest)assetBundle.LoadAsset("AssetBundleManifest", typeof(AssetBundleManifest));

            LoadSprite(ResType.Atlas, "common");
        }
Пример #2
0
        private bool LoadAssetBundleInternal(string abPath)
        {
            AssetBundleData bundle = null;

            if (dicAssetBundle.TryGetValue(abPath, out bundle))
            {
                bundle.ReferencedCount++;
                return(true);
            }

            if (dicAssetBundleCreateRequest.ContainsKey(abPath))
            {
                dicAssetBundleCreateRequestCount[abPath] += 1;
                return(true);
            }

            AssetBundleCreateRequest req = AssetBundle.LoadFromFileAsync(GameConfig.AssetPath(abPath));

            dicAssetBundleCreateRequest.Add(abPath, req);
            dicAssetBundleCreateRequestCount.Add(abPath, 1);
            LogUtil.LogYellow("加载资源-----------> " + abPath);
            return(false);
        }