Esempio n. 1
0
    public static ABDataScene GetObjectScene(string url)
    {
        ABLoadScene load = mUti.mFactory.GetABLoadScene(url, version);

        if (load == null)
        {
            return(null);
        }

        if (load.Error())
        {
            return(null);
        }

        ABDataScene data = new ABDataScene(url, "", typeof(ABLoadScene), load);

        datas.Add(data);

        return(data);
    }
Esempio n. 2
0
    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();
        }
    }