Пример #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="abModel"></param>
        /// <param name="callback"></param>
        static public void Load(string root = "", Action onLoaded = null)
        {
            if (root != "")
            {
                ResLoader = new AssetBundleMgr();
                ResLoader.Init(root, onLoaded);
            }
            else
            {
#if UNITY_EDITOR
                ResLoader = new DevResourceMgr();
                ResLoader.Init("", onLoaded);
                BDebug.Log("资源加载:AssetDataBase editor only");
#endif
            }
        }
Пример #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="abModel"></param>
        /// <param name="callback"></param>
        static public void Load(string root = "", Action onLoaded = null)
        {
            if (root != "")
            {
                var config = GameObject.Find("BDFrame").GetComponent <Config>();
                if (config != null)
                {
                    var version = config.Data.AssetBundleManagerVersion;
                    switch (version)
                    {
                    case AssetBundleManagerVersion.V1:
                    {
                        ResLoader = new AssetBundleMgr();
                        ResLoader.Init(root, onLoaded);
                    }
                    break;

                    case AssetBundleManagerVersion.V2_experiment:
                    {
                        ResLoader = new AssetBundleMgrV2();
                        ResLoader.Init(root, onLoaded);
                    }
                    break;
                    }
                }
                else
                {
                    ResLoader = new AssetBundleMgr();
                    ResLoader.Init(root, onLoaded);
                }
            }
            else
            {
#if UNITY_EDITOR
                ResLoader = new DevResourceMgr();
                ResLoader.Init("", onLoaded);
                BDebug.Log("资源加载:AssetDataBase editor only");
#endif
            }
        }