public AssetBundleMgr() { this.assetbundleMap = new Dictionary <string, AssetBundleReference>(); this.willDoTaskSet = new HashSet <int>(); this.allTaskList = new List <LoadTaskGroup>(); //1.设置加载路径 string path = ""; if (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer) { path = "Windows/Art"; } else if (Application.platform == RuntimePlatform.Android) { path = "Android/Art"; } else if (Application.platform == RuntimePlatform.IPhonePlayer) { path = "iOS/Art"; } var persistent = Path.Combine(Application.persistentDataPath, path).Replace("\\", "/"); var streamingAsset = Path.Combine(Application.streamingAssetsPath, path).Replace("\\", "/"); // resourcePath = File.Exists(persistent) ? persistent : streamingAsset; //2.加载menifest //persistent 和 streaming同时只能存在一个, //streaming是给appstore审核用, //过审后开始下载,则切回persistent模式 this.manifest = new AssetBundleManifestReference(resourcePath + "/Art"); }
public AssetBundleMgr() { this.manifest = new AssetBundleManifestReference(); this.assetbundleMap = new Dictionary <string, AssetBundleReference>(); this.mTaskHashTable = new HashSet <string>(); this.mAsyncTaskList = new List <AsyncTask>(); }
public AssetBundleMgr() { this.LocalHotUpdateResPath = Application.persistentDataPath; this.manifest = new AssetBundleManifestReference(); this.AssetbundleMap = new Dictionary <string, AssetBundleReference>(); this.taskHashSet = new HashSet <int>(); this.asyncTaskList = new List <AsyncTask>(); }
public AssetBundleMgr() { this.assetbundleMap = new Dictionary <string, AssetBundleReference>(); this.willDoTaskSet = new HashSet <int>(); this.allTaskList = new List <LoadTaskGroup>(); //1.设置加载路径 //persistent 和 streaming同时只能存在一个, path = Path.Combine(Application.persistentDataPath, Utils.GetPlatformPath(Application.platform) + "/Art").Replace("\\", "/"); var configPath = Path.Combine(this.path, "Config.json"); this.path = File.Exists(configPath) ? path : Path.Combine(Application.streamingAssetsPath, Utils.GetPlatformPath(Application.platform) + "/Art").Replace("\\", "/"); this.manifest = new AssetBundleManifestReference(configPath); BDebug.Log("Art加载路径:" + path, "red"); }
public AssetBundleMgr(string root) { //多热更切换,需要卸载 if (this.manifest != null) { this.UnloadAllAsset(); GC.Collect(); } this.assetbundleMap = new Dictionary <string, AssetBundleReference>(); this.willDoTaskSet = new HashSet <int>(); this.allTaskList = new List <LoadTaskGroup>(); //1.设置加载路径 path = (root + "/" + Utils.GetPlatformPath(Application.platform) + "/Art").Replace("\\", "/"); this.manifest = new AssetBundleManifestReference(path + "/Config.json"); BDebug.Log("Art加载路径:" + path, "red"); }
public AssetBundleMgr(string root, Action onLoded) { //多热更切换,需要卸载 if (this.config != null) { this.UnloadAllAsset(); GC.Collect(); } this.assetbundleMap = new Dictionary <string, AssetBundleWapper>(); this.allTaskGroupList = new List <LoaderTaskGroup>(); //1.设置加载路径 artRootPath = (root + "/" + BDUtils.GetPlatformPath(Application.platform) + "/Art").Replace("\\", "/"); secArtRootPath = (Application.streamingAssetsPath + "/" + BDUtils.GetPlatformPath(Application.platform) + "/Art") .Replace("\\", "/"); // string configPath = FindAsset("Config.json"); BDebug.Log("Art加载路径:" + configPath, "red"); // this.config = new AssetBundleManifestReference(configPath); this.config.OnLoaded = onLoded; }
/// <summary> /// 初始化 /// </summary> /// <param name="path"></param> /// <param name="onInitEnd"></param> public void Init(string path, Action onInitEnd) { //多热更切换,需要卸载 if (this.config != null) { this.UnloadAllAsset(); GC.Collect(); } this.AssetbundleMap = new Dictionary <string, AssetBundleWapper>(); this.allTaskGroupList = new List <LoaderTaskGroup>(); //1.设置加载路径 artRootPath = (path + "/" + BApplication.GetPlatformPath(Application.platform) + "/Art").Replace("\\", "/"); secArtRootPath = (Application.streamingAssetsPath + "/" + BApplication.GetPlatformPath(Application.platform) + "/Art") .Replace("\\", "/"); // string configPath = FindAsset("Config.json"); BDebug.Log("AssetBundle Version: V2", "red"); BDebug.Log("Art加载路径:" + configPath, "red"); // this.config = new AssetBundleManifestReference(); this.config.Load(configPath, onInitEnd); }