예제 #1
0
        /// <summary>
        /// 初始化加载Assetbundle的环境
        /// 该接口,一般用于测试
        /// </summary>
        /// <param name="abModel"></param>
        /// <param name="callback"></param>
        static public void InitLoadAssetBundleEnv(string path, RuntimePlatform platform)
        {
            var key = ZString.Concat(path, "_", platform);

            if (!loaderCacheMap.TryGetValue(key, out var loder))
            {
                ResLoader = new AssetBundleMgrV2();
                ResLoader.Init(path, platform);
                loaderCacheMap[key] = ResLoader;
            }
            else
            {
                ResLoader = loder;
            }

            //初始化对象池
            InitObjectPools();
        }
예제 #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="abModel"></param>
        /// <param name="callback"></param>
        static public void Init(AssetLoadPathType loadPathType)
        {
            BDebug.Log("【BResource】加载路径:" + loadPathType.ToString());
            if (loadPathType == AssetLoadPathType.Editor)
            {
#if UNITY_EDITOR //防止编译报错
                ResLoader = new DevResourceMgr();
                ResLoader.Init(null, RuntimePlatform.WindowsEditor);
#endif
            }
            else
            {
                var path = GameConfig.GetLoadPath(loadPathType);
                ResLoader = new AssetBundleMgrV2();
                ResLoader.Init(path, BApplication.RuntimePlatform);
            }

            //初始化对象池
            InitObjectPools();
        }