コード例 #1
0
        /// <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);
            }
        }
コード例 #2
0
        //初始化
        public void Initial(LoaderProgrocess progress)
        {
            delegateProgrocess = new LoaderProgrocess(progress);
            loadState          = 0;



            assetLoader = new IABLoader(progress, BundleLoadFinish);
        }
コード例 #3
0
        public IABLoader(LoaderProgrocess loadDelegate, LoadFinish tmploadFinish)
        {
            // Debug.Log("LoaderProgrocess   === LoaderProgrocess");

            loadPorgress = new LoaderProgrocess(loadDelegate);
            loadPorgress = loadDelegate;

            this.loadFinish = tmploadFinish;
        }
コード例 #4
0
    public void ChangeMsg(ushort msgid, string tmpScence, string tmpBundle, LoaderProgrocess tmpBack)
    {
        this.msgId = msgid;

        this.bundleName = tmpBundle;

        this.scenceName = tmpScence;

        this.backDelegate = tmpBack;
    }
コード例 #5
0
 public void AddLoadFnishBackDelegate(string bundleName, LoaderProgrocess progress)
 {
     if (allAsset.ContainsKey(bundleName))
     {
         loadManager.AddLoadFnishBackDelegate(allAsset[bundleName], progress);
     }
     else
     {
         Debuger.LogError("IABManager no contain  bundle ==" + bundleName);
     }
 }
コード例 #6
0
 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);
     }
 }
コード例 #7
0
        /// <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);
        }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
        /// <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);
            }
        }
コード例 #10
0
        /// <summary>
        /// 释放资源
        /// </summary>
        public void commonDispose()
        {
            //Debug.LogError("assetbundle =="+ bundleName);

            if (commonRes != null)
            {
                commonRes.Dispose();

                commonRes = null;

                bundleName = null;

                loadFinish = null;

                loadPorgress = null;
            }
        }
コード例 #11
0
 public void AddLoadFnishBackDelegate(LoaderProgrocess progress)
 {
     assetLoader.AddDelegate(progress);
 }
コード例 #12
0
        /// <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);
                }
            }
        }
コード例 #13
0
 public void AddDelegate(LoaderProgrocess loadDelegate)
 {
     loadPorgress += loadDelegate;
 }