public override IEnumerator StartIEnumeratorTask(Action finishCallback)
        {
            //开启的时候已经结束了
            if (refCount <= 0)
            {
                OnResLoadFaild();
                finishCallback();
                yield break;
            }

            string url = ProjectPathConfigTemp.AssetBundleName2Url(m_Name);
            AssetBundleCreateRequest abcR = AssetBundle.LoadFromFileAsync(url);

            m_AssetBundleCreateRequest = abcR;
            yield return(abcR);

            m_AssetBundleCreateRequest = null;

            if (!abcR.isDone)
            {
                Log.e("AssetBundleCreateRequest Not Done! Path:" + m_Name);
                OnResLoadFaild();
                finishCallback();
                yield break;
            }

            assetBundle = abcR.assetBundle;

            resState = eResState.kReady;
            finishCallback();
        }
        public override bool LoadSync()
        {
            if (!CheckLoadAble())
            {
                return(false);
            }

            resState = eResState.kLoading;

            //TimeDebugger timer = ResMgr.Instance.timeDebugger;

            string url = ProjectPathConfigTemp.AssetBundleName2Url(m_Name);

            //timer.Begin("LoadSync AssetBundle:" + m_Name);
            AssetBundle bundle = AssetBundle.LoadFromFile(url);

            //timer.End();

            m_UnloadFlag = true;

            if (bundle == null)
            {
                Log.e("Failed Load AssetBundle:" + m_Name);
                OnResLoadFaild();
                return(false);
            }

            assetBundle = bundle;
            resState    = eResState.kReady;

            //Log.i(string.Format("Load AssetBundle Success.ID:{0}, Name:{1}", bundle.GetInstanceID(), bundle.name));

            //timer.Dump(-1);
            return(true);
        }
Exemple #3
0
        public string[] GetAllDependenciesByUrl(string url)
        {
            string abName = ProjectPathConfigTemp.AssetBundleUrl2Name(url);

            string[] depends = null;

            for (int i = m_ActiveAssetDataPackages.Count - 1; i >= 0; --i)
            {
                if (!m_ActiveAssetDataPackages[i].GetAssetBundleDepends(abName, out depends))
                {
                    continue;
                }

                return(depends);
            }

            return(null);
        }
 public static string[] GetAllDependenciesByUrl(string url)
 {
     return(m_Manifest.GetAllDependencies(ProjectPathConfigTemp.AssetBundleUrl2Name(url)));
 }