Пример #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="abModel"></param>
        /// <param name="callback"></param>
        static public void Load(string root = "")
        {
            if (root != "")
            {
                resLoader = new AssetBundleMgr(root);
            }
            else
            {
#if UNITY_EDITOR
                resLoader = new DevResourceMgr();
                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 != "")
            {
                ResLoader = new AssetBundleMgr();
                ResLoader.Init(root, onLoaded);
            }
            else
            {
#if UNITY_EDITOR
                ResLoader = new DevResourceMgr();
                ResLoader.Init("", onLoaded);
                BDebug.Log("资源加载:AssetDataBase editor only");
#endif
            }
        }
Пример #3
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="abModel"></param>
 /// <param name="callback"></param>
 static public void Init(bool isAssetBundle)
 {
     #if UNITY_EDITOR
     if (isAssetBundle)
     {
         resLoader = new AssetBundleMgr();
         BDebug.Log("资源加载:AssetBundle");
     }
     else
     {
         resLoader = new DevResourceMgr();
         BDebug.Log("资源加载:AssetDataBase editor only");
     }
     #else
     resLoader = new AssetBundleMgr();
     #endif
 }
Пример #4
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
            }
        }