public ABDataScene(string url, string resname, System.Type type, ABLoadScene sceneload) 
        : base(url, resname, type, sceneload)
    {
        mProgress = 0;

        mCount = mLoadScene.asset.material.Length + 3;
    }
        public ABLoadScene AddABLoadScene(string url, int version, ABDataType abtype)
        {
            string keyName = url + version.ToString();

            ABLoadScene bl = new ABLoadScene(version, abtype);

            mABLoadScenes[keyName] = bl;

            return(bl);
        }
    public override void Create()
    {
        mLoadScene = (ABLoadScene)mLoad;

        mProgress = 0;

        //mDontDestroyOnLoad = true;

        _Create();
    }
    public IEnumerator SceneCallBack(ABLoadScene mAB, string url, string resname, ABDataType abtype = ABDataType.Mpq)
    {
        Count++;

        string errorcode = string.Empty;

        do
        {
            if (!mAB.Create(url))
            {
                errorcode = "ABLoadScene Create " + url;

                break;
            }

            yield return StartCoroutine(mAB.Waiting());

            Debuger.Log("Waiting End ");

            while (true)
            {
                if (mAB.IsWWW())
                    break;

                yield return null;
            }

            if (mAB.Error())
            {
                errorcode = mAB.GetErrorMsg();

                break;
            }
            else
            {
                //  返回
                if (OnSceneFinishLoading != null)
                {
                    //Debuger.Log("AssetBundleUti.OnFinishLoading " + System.IO.Path.GetFileName(url) + " " + resname + " " + type.ToString());

                    OnSceneFinishLoading(url, resname, true);
                }

            }

            yield return 1;
        }
        while (false);

        if (OnSceneFinishLoading != null)
        {
            //Debuger.Log("AssetBundleUti.OnFinishLoading " + System.IO.Path.GetFileName(url) + " " + resname + " " + type.ToString());

            curContent = errorcode;

            OnSceneFinishLoading(url, resname, false, errorcode);
        }

        Count--;

        releaseQueue.Enqueue(mAB);

        if (Count <= 0)
        {
            Count = 0;
            releaseAllBundles();
        }

    }
        public void CleanABByScene()
        {
            ////foreach (KeyValuePair<string, ABLoad> e in mABLoads)
            ////{
            ////    ABLoad bl = (ABLoad)mABLoads[e.Key];
            ////    if (!bl.IsDontDestroyOnLoad())
            ////    {
            ////        bl.Dispose();
            ////        bl = null;

            ////        mABLoads.Remove(e.Key);
            ////    }
            ////}
            ////mABLoads.Clear();
            ////mABLoads = null;


            {
                List <string> listABLoadOrders = new List <string>(mABLoads.Keys);
                List <ABLoad> listABLoad       = new List <ABLoad>(mABLoads.Values);
                for (int i = 0; i < listABLoad.Count; i++)
                {
                    ABLoad bl = (ABLoad)listABLoad[i];
                    if (!bl.IsDontDestroyOnLoad())
                    {
                        bl.Dispose();
                        bl = null;
                    }

                    //  根据序号去删除.
                    mABLoads.Remove(listABLoadOrders[i]);
                }
                listABLoadOrders.Clear();
                listABLoad.Clear();
                listABLoadOrders = null;
                listABLoad       = null;
            }

            {
                List <string>      listABLoadOrders = new List <string>(mABLoadScenes.Keys);
                List <ABLoadScene> listABLoad       = new List <ABLoadScene>(mABLoadScenes.Values);
                for (int i = 0; i < listABLoad.Count; i++)
                {
                    ABLoadScene bl = (ABLoadScene)listABLoad[i];
                    if (!bl.IsDontDestroyOnLoad())
                    {
                        bl.Dispose();
                        bl = null;
                    }

                    //  根据序号去删除.
                    mABLoadScenes.Remove(listABLoadOrders[i]);
                }
                listABLoadOrders.Clear();
                listABLoad.Clear();
                listABLoadOrders = null;
                listABLoad       = null;
            }

            ////foreach (KeyValuePair<string, ABLoadScene> e in mABLoadScenes)
            ////{
            ////    ABLoadScene bl = (ABLoadScene)mABLoadScenes[e.Key];
            ////    if (!bl.IsDontDestroyOnLoad())
            ////    {
            ////        bl.Dispose();
            ////        bl = null;

            ////        mABLoadScenes.Remove(e.Key);
            ////    }

            ////}
            ////mABLoadScenes.Clear();
            ////mABLoadScenes = null;
        }
Example #6
0
        public ABLoadScene AddABLoadScene(string url, int version, ABDataType abtype)
        {
            string keyName = url + version.ToString();

            ABLoadScene bl = new ABLoadScene(version, abtype);
            mABLoadScenes[keyName] = bl;

            return bl;
        }
    public override void Destory()
    {
        if (mLoadScene != null)
        {
            mLoadScene = null;
        }

        if (_ABLoadGoMono != null)
        {
            _ABLoadGoMono.Clear();
            GameObject.Destroy(_ABLoadGoMono);
            _ABLoadGoMono = null;
        }

        if (_scene != null)
        {
            _scene.SetActive(false);
            GameObject.Destroy(_scene);
            _scene = null;
        }
        _scene = null;

        if (_nav != null)
        {
            _nav.SetActive(false);
            GameObject.Destroy(_nav);
            _nav = null;
        }
        _nav = null;
        _asset = null;
        _lightmap = null;

        base.Destory();
    }