/// <summary> /// /// </summary> /// <param name="bundleName"> 为相对路径 like ==ScenceOne/Prefeb.ld </param> /// <param name="referName"></param> /// <param name="progress"></param> public void LoadAssetBundle(string bundleName, LoaderProgrocess progress, LoadAssetBundleCallBack callBack) { if (!loadHelper.ContainsKey(bundleName)) { IABRelationManager loader = new IABRelationManager(); loader.Initial(progress); loader.SetBundleName(bundleName); loadHelper.Add(bundleName, loader); // Debug.Log("CALL BACK =="+ bundleName); //让 ILoadManager去加载 public IEnumerator LoadAssetBundles(string bundleName) callBack(scenceName, bundleName); //StartCoroutine(LoadAssetBundles(bundleName)); // StartCoroutine(loader.LoadAssetBundle()); } else { //progress(bundleName,1); Debuger.LogError("IABManager have contain bundleName ==" + bundleName); } }
//初始化 public void Initial(LoaderProgrocess progress) { delegateProgrocess = new LoaderProgrocess(progress); loadState = 0; assetLoader = new IABLoader(progress, BundleLoadFinish); }
public IABLoader(LoaderProgrocess loadDelegate, LoadFinish tmploadFinish) { // Debug.Log("LoaderProgrocess === LoaderProgrocess"); loadPorgress = new LoaderProgrocess(loadDelegate); loadPorgress = loadDelegate; this.loadFinish = tmploadFinish; }
public void ChangeMsg(ushort msgid, string tmpScence, string tmpBundle, LoaderProgrocess tmpBack) { this.msgId = msgid; this.bundleName = tmpBundle; this.scenceName = tmpScence; this.backDelegate = tmpBack; }
public void AddLoadFnishBackDelegate(string bundleName, LoaderProgrocess progress) { if (allAsset.ContainsKey(bundleName)) { loadManager.AddLoadFnishBackDelegate(allAsset[bundleName], progress); } else { Debuger.LogError("IABManager no contain bundle ==" + bundleName); } }
public void AddLoadFinishBackDelegate(string scenceName, string bundleName, LoaderProgrocess progress) { if (loadManagers.ContainsKey(scenceName)) { IABScenceManager tmpManager = loadManagers[scenceName]; tmpManager.AddLoadFnishBackDelegate(bundleName, progress); } else { Debuger.Log("IloadManager GetSingleResources no key ==" + scenceName + "==BundleNamke==" + bundleName); } }
/// <summary> /// Loads the asset. 加载场景资源 /// </summary> /// <param name="scenceName">Scence name.</param> /// <param name="bundleName">Bundle name.</param> /// <param name="progress">Progress.</param> public void LoadAsset(string scenceName, string bundleName, LoaderProgrocess progress) { // Debug.Log("bundleName=="+ bundleName); if (!loadManagers.ContainsKey(scenceName)) { ReadConfiger(scenceName); } IABScenceManager tmpManager = loadManagers[scenceName]; tmpManager.LoadAsset(bundleName, progress, LoadCallBack); }
public void AddLoadFnishBackDelegate(string bundleName, LoaderProgrocess progress) { if (loadHelper.ContainsKey(bundleName)) { IABRelationManager loader = loadHelper[bundleName]; loader.AddLoadFnishBackDelegate(progress); } else { Debuger.Log("IABManager no contain bundle ==" + bundleName); } }
/// <summary> /// 第二步 读取 单个包中 资源 /// </summary> /// <param name="bundleName"></param> public void LoadAsset(string bundleName, LoaderProgrocess progress, LoadAssetBundleCallBack callBack) { if (allAsset.ContainsKey(bundleName)) { string tmpValue = allAsset[bundleName]; // Debug.Log("LoadAsset =="+ tmpValue); loadManager.LoadAssetBundle(allAsset[bundleName], progress, callBack); } else { Debuger.LogError("Donot contain budnle ==" + bundleName); } }
/// <summary> /// 释放资源 /// </summary> public void commonDispose() { //Debug.LogError("assetbundle =="+ bundleName); if (commonRes != null) { commonRes.Dispose(); commonRes = null; bundleName = null; loadFinish = null; loadPorgress = null; } }
public void AddLoadFnishBackDelegate(LoaderProgrocess progress) { assetLoader.AddDelegate(progress); }
/// <summary> /// /// </summary> /// <param name="bundleName"> like ==ScenceOne\Prefeb.ld </param> /// <param name="referName"></param> /// <param name="progress"></param> public IEnumerator LoadAssetBundleDependences(string bundleName, string referName, LoaderProgrocess progress) { if (!loadHelper.ContainsKey(bundleName)) { // Debuger.Log("bundle =="+ referName +"==dependec=="+bundleName); IABRelationManager loader = new IABRelationManager(); loader.Initial(progress); loader.SetBundleName(bundleName); if (referName != null) { loader.AddReferrence(referName); } loadHelper.Add(bundleName, loader); yield return(LoadAssetBundles(bundleName)); // StartCoroutine(LoadAssetBundles(bundleName)); // StartCoroutine(loader.LoadAssetBundle()); } else { if (referName != null) { IABRelationManager loader = loadHelper[bundleName]; loader.AddReferrence(referName); } } }
public void AddDelegate(LoaderProgrocess loadDelegate) { loadPorgress += loadDelegate; }