Ejemplo n.º 1
0
        private static IEnumerator DownloadFile(LoaderRequest rRequest)
        {
            UnityWebRequest rWebRequest = UnityWebRequest.Get(rRequest.Url);

            yield return(rWebRequest.SendWebRequest());

            if (rWebRequest.isNetworkError || !string.IsNullOrEmpty(rWebRequest.error))
            {
                Debug.Log(rWebRequest.error);
                rWebRequest.Dispose();
                rRequest.SetResult(rRequest);
                yield break;
            }

            var rDownloadHandler = rWebRequest.downloadHandler;

            if (rDownloadHandler == null)
            {
                rRequest.SetResult(rRequest);
                yield break;
            }

            rRequest.IsDone = true;
            rRequest.Text   = rDownloadHandler.text;
            rRequest.Bytes  = rDownloadHandler.data;

            rRequest.SetResult(rRequest);

            rWebRequest.Dispose();
            rDownloadHandler.Dispose();
            rWebRequest      = null;
            rDownloadHandler = null;
        }
Ejemplo n.º 2
0
        public static LoaderRequest Download(string rURL)
        {
            LoaderRequest rRequest = new LoaderRequest(rURL);

            rRequest.Start(Download_Async(rRequest));
            return(rRequest);
        }
Ejemplo n.º 3
0
        private static IEnumerator DownloadFile_Async(LoaderRequest rRequest)
        {
            UnityWebRequest rWebRequest = UnityWebRequest.Get(rRequest.Url);

            CoroutineManager.Instance.Start(Record_DownloadProgress_Async(rRequest, rWebRequest));
            yield return(rWebRequest.Send());

            if (rWebRequest.isNetworkError)
            {
                Debug.Log(rWebRequest.error);
                rWebRequest.Dispose();
                yield break;
            }

            var rDownloadHandler = rWebRequest.downloadHandler;

            if (rDownloadHandler == null)
            {
                yield break;
            }

            rRequest.IsDone = true;
            rRequest.Text   = rDownloadHandler.text;
            rRequest.Bytes  = rDownloadHandler.data;

            rWebRequest.Dispose();
            rDownloadHandler.Dispose();
            rWebRequest      = null;
            rDownloadHandler = null;
        }
Ejemplo n.º 4
0
        public static async Task <LoaderRequest> Load(string rURL)
        {
            LoaderRequest rRequest    = new LoaderRequest(rURL);
            string        rVersionURL = rRequest.Url;

            WWWAssist.LoaderRequest rWWWVersionRequest = await WWWAssist.LoadFile(rVersionURL);

            if (rWWWVersionRequest.Bytes == null || rWWWVersionRequest.Bytes.Length == 0)
            {
                return(null);
            }

            ABVersion rVersion = new ABVersion();

            using (var ms = new MemoryStream(rWWWVersionRequest.Bytes))
            {
                using (var br = new BinaryReader(ms))
                {
                    rVersion.Deserialize(br);
                }
            }
            rRequest.Version = rVersion;

            return(rRequest);
        }
Ejemplo n.º 5
0
        public static LoaderRequest DownloadFile(string rURL, System.Action <float> rDownloadProgress = null)
        {
            LoaderRequest rRequest = new LoaderRequest(rURL, rDownloadProgress);

            rRequest.Start(DownloadFile_Async(rRequest));
            return(rRequest);
        }
Ejemplo n.º 6
0
        public static async Task <LoaderRequest> DownloadFile(string rURL, System.Action <float> rDownloadProgress = null)
        {
            LoaderRequest rRequest = new LoaderRequest(rURL, rDownloadProgress);

            UnityWebRequest rWebRequest        = UnityWebRequest.Get(rRequest.Url);
            var             rProgressCoroutine = CoroutineManager.Instance.StartHandler(Record_DownloadProgress_Async(rRequest, rWebRequest));
            await rWebRequest.SendWebRequest();

            if (rWebRequest.isNetworkError)
            {
                Debug.Log(rWebRequest.error);
                rWebRequest.Dispose();
                return(null);
            }

            var rDownloadHandler = rWebRequest.downloadHandler;

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

            rRequest.IsDone = true;
            rRequest.Text   = rDownloadHandler.text;
            rRequest.Bytes  = rDownloadHandler.data;

            rWebRequest.Dispose();
            rDownloadHandler.Dispose();
            rWebRequest      = null;
            rDownloadHandler = null;
            CoroutineManager.Instance.Stop(rProgressCoroutine);

            return(rRequest);
        }
Ejemplo n.º 7
0
        public static LoaderRequest LoadFile(string rURL)
        {
            LoaderRequest rRequest = new LoaderRequest(rURL);

            rRequest.Start(LoadFile_Async(rRequest));
            return(rRequest);
        }
Ejemplo n.º 8
0
        private IEnumerator LoadAllAssets_ByAssetbundle(LoaderRequest rRequest, AssetBundle rAssetbundle)
        {
            var rAllAssetsRequest = rAssetbundle.LoadAllAssetsAsync();

            yield return(rAllAssetsRequest);

            rRequest.AllAssets = rAllAssetsRequest.allAssets;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 异步加载UI
        /// </summary>
        public LoaderRequest LoadUI(string rViewName)
        {
            LoaderRequest rRequest = new LoaderRequest(rViewName);

            rRequest.Start(LoadUI_Async(rRequest));

            return(rRequest);
        }
Ejemplo n.º 10
0
 private static IEnumerator Record_DownloadProgress_Async(LoaderRequest rRequest, UnityWebRequest rWebRequest)
 {
     while (!rRequest.IsDone)
     {
         UtilTool.SafeExecute(rRequest.DownloadProgress, rWebRequest.downloadProgress);
         yield return(0);
     }
     rWebRequest = null;
 }
Ejemplo n.º 11
0
        private IEnumerator LoadAsset_Async(LoaderRequest rRequest)
        {
            ABLoadEntry rAssetLoadEntry = null;

            if (!ABLoaderVersion.Instance.TryGetValue(rRequest.Path, out rAssetLoadEntry))
            {
                Debug.LogErrorFormat("Can not find assetbundle: -- {0}", rRequest.Path);
                rRequest.Asset = null;
                rRequest.SetResult(rRequest);
                yield break;
            }

            //引用计数加1
            rAssetLoadEntry.RefCount++;

            // 确认未加载完成并且正在被加载、一直等待其加载完成
            while (rAssetLoadEntry.IsLoading && !rAssetLoadEntry.IsLoadCompleted)
            {
                yield return(new WaitForEndOfFrame());
            }

            // 如果该资源加载完成了
            if (!rAssetLoadEntry.IsLoading && rAssetLoadEntry.IsLoadCompleted)
            {
                // 从缓存的Assetbundle里面加载资源
                yield return(LoadAssetObject(rRequest, rAssetLoadEntry, false));

                rRequest.SetResult(rRequest);
                yield break;
            }

            // 开始加载资源依赖项
            if (rAssetLoadEntry.ABDependNames != null && !rRequest.IsSimulate)
            {
                for (int i = rAssetLoadEntry.ABDependNames.Length - 1; i >= 0; i--)
                {
                    string rDependABPath = rAssetLoadEntry.ABDependNames[i];
                    string rDependABName = rDependABPath;

                    LoaderRequest rDependAssetRequest = new LoaderRequest(rDependABName, "", false, rRequest.IsSimulate, false);
                    yield return(LoadAsset_Async(rDependAssetRequest));
                }
            }

            //开始加载当前的资源包
            rAssetLoadEntry.IsLoading       = true;
            rAssetLoadEntry.IsLoadCompleted = false;

            // 真正的从AB包里面加载资源
            yield return(LoadAssetObject(rRequest, rAssetLoadEntry, true));

            rRequest.SetResult(rRequest);

            rAssetLoadEntry.IsLoading       = false;
            rAssetLoadEntry.IsLoadCompleted = true;
        }
Ejemplo n.º 12
0
        public IAsyncOperation <LoaderRequest> LoadAllAssets(string rAssetbundleName, bool bIsSimulate)
        {
            if (!this.LoadedAssetbundles.Contains(rAssetbundleName))
            {
                this.LoadedAssetbundles.Add(rAssetbundleName);
            }

            LoaderRequest rRequest = new LoaderRequest(rAssetbundleName, "AllAssets", false, bIsSimulate, true);

            return(rRequest.Start(LoadAsset_Async(rRequest)));
        }
Ejemplo n.º 13
0
        private static IEnumerator LoadFile_Async(LoaderRequest rRequest)
        {
            WWW www = WWWAssist.Load(rRequest.Url);

            yield return(www);

            rRequest.Text  = www.text;
            rRequest.Bytes = www.bytes;

            WWWAssist.Destroy(ref www);
        }
Ejemplo n.º 14
0
        public IAsyncOperation <LoaderRequest> LoadScene(string rAssetbundleName, string rScenePath)
        {
            if (!this.LoadedScenebundles.Contains(rAssetbundleName))
            {
                this.LoadedScenebundles.Add(rAssetbundleName);
            }

            LoaderRequest rSceneRequest = new LoaderRequest(rAssetbundleName, rScenePath, true, false, false);

            return(rSceneRequest.Start(LoadAsset_Async(rSceneRequest)));
        }
Ejemplo n.º 15
0
        private static IEnumerator Record_DownloadProgress_Async(LoaderRequest rRequest, UnityWebRequest rWebRequest)
        {
            while (!rRequest.IsDone)
            {
                try { UtilTool.SafeExecute(rRequest.DownloadProgress, rWebRequest.downloadProgress); }
                catch (System.Exception) { break; }

                yield return(new WaitForEndOfFrame());
            }
            rWebRequest = null;
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 根据名字异步加载UI
        /// </summary>
        private IEnumerator LoadUI_Async(LoaderRequest rRequest)
        {
            string rUIABPath     = "game/ui/" + rRequest.ViewName.ToLower() + ".ab";
            var    rAssetRequest = ABLoader.Instance.LoadAsset(rUIABPath, rRequest.ViewName, ABPlatform.Instance.IsSumilateMode_GUI());

            yield return(rAssetRequest);

            if (rAssetRequest.Asset != null)
            {
                rRequest.ViewPrefabGo = rAssetRequest.Asset as GameObject;
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 异步加载UI
        /// </summary>
        public async Task <LoaderRequest> LoadUI(string rViewName)
        {
            LoaderRequest rRequest      = new LoaderRequest(rViewName);
            string        rUIABPath     = "game/ui/prefabs/" + rRequest.ViewName.ToLower() + ".ab";
            var           rAssetRequest = await AssetLoader.Instance.LoadAssetAsync(rUIABPath, rRequest.ViewName, AssetLoader.Instance.IsSumilateMode_GUI());

            if (rAssetRequest.Asset != null)
            {
                rRequest.ViewPrefabGo = rAssetRequest.Asset as GameObject;
            }
            return(rRequest);
        }
Ejemplo n.º 18
0
        public LoaderRequest LoadAsset(string rAssetbundleName, string rAssetName, bool bIsSimulate)
        {
            if (!this.LoadedAssetbundles.Contains(rAssetbundleName))
            {
                this.LoadedAssetbundles.Add(rAssetbundleName);
            }

            LoaderRequest rRequest = new LoaderRequest(rAssetbundleName, rAssetName, false, bIsSimulate);

            rRequest.Start(LoadAsset_Async(rRequest));
            return(rRequest);
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 异步加载UI
        /// </summary>
        public async Task <LoaderRequest> LoadUI(string rViewName)
        {
            LoaderRequest rRequest      = new LoaderRequest(rViewName);
            string        rUIABPath     = "GUI/Prefabs/" + rRequest.ViewName;
            var           rAssetRequest = await AssetLoader.Instance.LoadAsset(rUIABPath, typeof(GameObject));

            if (rAssetRequest.Asset != null)
            {
                rRequest.ViewPrefabGo = rAssetRequest.Asset as GameObject;
            }
            return(rRequest);
        }
Ejemplo n.º 20
0
        public LoaderRequest LoadScene(string rAssetbundleName, string rScenePath)
        {
            if (!this.loadedScenebundles.Contains(rAssetbundleName))
            {
                this.loadedScenebundles.Add(rAssetbundleName);
            }

            LoaderRequest rSceneRequest = new LoaderRequest(rAssetbundleName, rScenePath, true);

            rSceneRequest.Start(LoadAsset_Async(rSceneRequest));
            return(rSceneRequest);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 根据名字异步加载UI
        /// </summary>
        private IEnumerator LoadUI_Async(LoaderRequest rLoaderRequest)
        {
            var rRequest = Resources.LoadAsync(rLoaderRequest.ViewName, typeof(GameObject));

            yield return(rRequest);

            if (rRequest == null || rRequest.asset == null)
            {
                Debug.LogErrorFormat("Not found UI {0}.", rLoaderRequest.ViewName);
                yield break;
            }
            rLoaderRequest.ViewPrefabGo = rRequest.asset as GameObject;
        }
Ejemplo n.º 22
0
        public async static Task <LoaderRequest> LoadFile(string rURL)
        {
            LoaderRequest rRequest = new LoaderRequest(rURL);

            WWW   www = WWWAssist.Load(rRequest.Url);
            await www;

            rRequest.Text  = www.text;
            rRequest.Bytes = www.bytes;
            WWWAssist.Destroy(ref www);

            return(rRequest);
        }
Ejemplo n.º 23
0
        public static IEnumerator LoadFile(LoaderRequest rRequest)
        {
            WWW www = WWWAssist.Load(rRequest.Url);

            yield return(www);

            rRequest.Text  = www.text;
            rRequest.Bytes = www.bytes;

            rRequest.SetResult(rRequest);

            WWWAssist.Destroy(ref www);
        }
Ejemplo n.º 24
0
        public async Task <LoaderRequest> LoadAllAssets(string rAssetbundleName, bool bIsSimulate)
        {
            if (!this.LoadedAssetbundles.Contains(rAssetbundleName))
            {
                this.LoadedAssetbundles.Add(rAssetbundleName);
            }

            LoaderRequest rRequest = new LoaderRequest(rAssetbundleName, "AllAssets", false, bIsSimulate, true);

            await LoadAsset_Async(rRequest);

            return(rRequest);
        }
Ejemplo n.º 25
0
        public async Task <LoaderRequest> LoadScene(string rAssetbundleName, string rScenePath)
        {
            if (!this.LoadedScenebundles.Contains(rAssetbundleName))
            {
                this.LoadedScenebundles.Add(rAssetbundleName);
            }

            LoaderRequest rSceneRequest = new LoaderRequest(rAssetbundleName, rScenePath, true, false, false);

            await LoadAsset_Async(rSceneRequest);

            return(rSceneRequest);
        }
Ejemplo n.º 26
0
        private static IEnumerator Download_Async(LoaderRequest rRequest)
        {
            string rVersionURL = rRequest.Url;

            WebRequestAssist.LoaderRequest rWebVersionRequest = WebRequestAssist.DownloadFile(rVersionURL);
            yield return(rWebVersionRequest);

            if (rWebVersionRequest.Bytes == null || rWebVersionRequest.Bytes.Length == 0)
            {
                yield break;
            }

            ABVersion rVersion = new ABVersion();

            using (var ms = new MemoryStream(rWebVersionRequest.Bytes))
            {
                using (var br = new BinaryReader(ms))
                {
                    rVersion.Deserialize(br);
                }
            }
            rRequest.Version = rVersion;
        }
Ejemplo n.º 27
0
        private IEnumerator LoadAsset_Async(LoaderRequest rRequest)
        {
            ABLoadEntry rAssetLoadEntry = null;

            if (!ABLoaderVersion.Instance.TryGetValue(rRequest.Path, out rAssetLoadEntry))
            {
                Debug.LogErrorFormat("Can not find assetbundle: -- {0}", rRequest.Path);
                rRequest.Asset = null;
                yield break;
            }

            // 确认该资源是否已经加载完成或者正在被加载
            while (rAssetLoadEntry.IsLoading && !rAssetLoadEntry.IsLoadCompleted)
            {
                yield return(0);
            }

            //引用计数加1
            rAssetLoadEntry.RefCount++;

            // 开始加载资源依赖项
            if (rAssetLoadEntry.ABDependNames != null && !rRequest.IsSimulate)
            {
                for (int i = rAssetLoadEntry.ABDependNames.Length - 1; i >= 0; i--)
                {
                    string rDependABPath = rAssetLoadEntry.ABDependNames[i];
                    string rDependABName = rDependABPath;

                    LoaderRequest rDependAssetRequest = new LoaderRequest(rDependABName, "", false, rRequest.IsSimulate);
                    yield return(rDependAssetRequest.Start(LoadAsset_Async(rDependAssetRequest)));
                }
            }

            // 如果该资源加载完成了
            if (!rAssetLoadEntry.IsLoading && rAssetLoadEntry.IsLoadCompleted)
            {
                if (!string.IsNullOrEmpty(rRequest.AssetName))
                {
                    AssetBundleRequest rABRequest = rAssetLoadEntry.CacheAsset.LoadAssetAsync(rRequest.AssetName);
                    yield return(rABRequest);

                    rRequest.Asset = rABRequest.asset;
                }
                yield break;
            }

            //开始加载当前的资源包
            rAssetLoadEntry.IsLoading       = true;
            rAssetLoadEntry.IsLoadCompleted = false;

            string rAssetLoadUrl = rAssetLoadEntry.ABPath;

            if (rRequest.IsSimulate)
            {
                Debug.Log("---Simulate Load ab: " + rAssetLoadUrl);
#if UNITY_EDITOR
                if (!string.IsNullOrEmpty(rRequest.AssetName) && !rRequest.IsScene)
                {
                    string[] rAssetPaths = UnityEditor.AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(rAssetLoadEntry.ABName, rRequest.AssetName);
                    if (rAssetPaths.Length == 0)
                    {
                        Debug.LogError("There is no asset with name \"" + rRequest.AssetName + "\" in " + rAssetLoadEntry.ABName);
                        yield break;
                    }
                    Object rTargetAsset = UnityEditor.AssetDatabase.LoadMainAssetAtPath(rAssetPaths[0]);
                    rRequest.Asset = rTargetAsset;
                }
#endif
            }
            else
            {
                Debug.Log("---Real Load ab: " + rAssetLoadUrl);

                var rAssetbundleCreateRequest = AssetBundle.LoadFromFileAsync(rAssetLoadUrl);
                yield return(rAssetbundleCreateRequest);

                // 如果是一个直接的资源,将资源的对象取出来
                rAssetLoadEntry.CacheAsset = rAssetbundleCreateRequest.assetBundle;

                // 加载Object
                if (!string.IsNullOrEmpty(rRequest.AssetName))
                {
                    if (!rRequest.IsScene)
                    {
                        AssetBundleRequest rABRequest = rAssetLoadEntry.CacheAsset.LoadAssetAsync(rRequest.AssetName);
                        yield return(rABRequest);

                        rRequest.Asset = rABRequest.asset;
                    }
                    else
                    {
                        rAssetLoadEntry.CacheAsset.GetAllScenePaths();
                    }
                }
            }
            rAssetLoadEntry.IsLoading       = false;
            rAssetLoadEntry.IsLoadCompleted = true;
        }
Ejemplo n.º 28
0
        private IEnumerator LoadAsset_Async(LoaderRequest rRequest)
        {
            // 确认Manifest已经加载完成
            while (!isManifestLoadCompleted)
            {
                yield return(0);
            }

            AssetLoadInfo rAssetLoadInfo = null;

            if (!assetLoadInfos.TryGetValue(rRequest.path, out rAssetLoadInfo))
            {
                Debug.LogErrorFormat("找不到该资源 -- {0}", rRequest.path);
                rRequest.asset = null;
                yield break;
            }

            // 确认该资源是否已经加载完成或者正在被加载
            while (rAssetLoadInfo.isLoading && !rAssetLoadInfo.isLoadCompleted)
            {
                yield return(0);
            }

            //引用计数加1
            rAssetLoadInfo.refCount++;

            // 如果该资源加载完成了
            if (!rAssetLoadInfo.isLoading && rAssetLoadInfo.isLoadCompleted)
            {
                if (!string.IsNullOrEmpty(rRequest.assetName))
                {
                    AssetBundleRequest rABRequest = rAssetLoadInfo.cacheAsset.LoadAssetAsync(rRequest.assetName);
                    yield return(rABRequest);

                    rRequest.asset = rABRequest.asset;
                }
                yield break;
            }

            // 开始加载资源依赖项
            if (rAssetLoadInfo.abDependNames != null)
            {
                for (int i = rAssetLoadInfo.abDependNames.Length - 1; i >= 0; i--)
                {
                    string rDependABPath = rAssetLoadInfo.abDependNames[i];
                    string rDependABName = rDependABPath;

                    LoaderRequest rDependAssetRequest = new LoaderRequest(rDependABName, "", false);
                    rDependAssetRequest.Start(LoadAsset_Async(rDependAssetRequest));
                    yield return(rDependAssetRequest.Coroutine);
                }
            }

            //开始加载当前的资源包
            rAssetLoadInfo.isLoading       = true;
            rAssetLoadInfo.isLoadCompleted = false;

            string rAssetLoadUrl = AssetPlatformManager.Instance.GetStreamingUrl_CurPlatform(rAssetLoadInfo.abPath);
            WWW    www           = new WWW(rAssetLoadUrl);

            yield return(www);

            // 如果是一个直接的资源,将资源的对象取出来
            rAssetLoadInfo.cacheAsset = www.assetBundle;

            WWWAssist.Destroy(ref www);

            // 加载Object
            if (!string.IsNullOrEmpty(rRequest.assetName))
            {
                if (!rRequest.isScene)
                {
                    AssetBundleRequest rABRequest = rAssetLoadInfo.cacheAsset.LoadAssetAsync(rRequest.assetName);
                    yield return(rABRequest);

                    rRequest.asset = rABRequest.asset;
                }
                else
                {
                    rAssetLoadInfo.cacheAsset.GetAllScenePaths();
                }
            }

            rAssetLoadInfo.isLoading       = false;
            rAssetLoadInfo.isLoadCompleted = true;
        }
Ejemplo n.º 29
0
        public static IAsyncOperation <LoaderRequest> DownloadFile(string rURL, System.Action <float> rDownloadProgress = null)
        {
            var rRequest = new LoaderRequest(rURL);

            return(rRequest.Start(DownloadFile(rRequest)));
        }
Ejemplo n.º 30
0
        private IEnumerator LoadAssetObject(LoaderRequest rRequest, ABLoadEntry rAssetLoadEntry, bool bRealLoad)
        {
            string rAssetLoadUrl = rAssetLoadEntry.ABPath;

            if (rRequest.IsSimulate)
            {
                Debug.Log("---Simulate Load ab: " + rAssetLoadUrl);
#if UNITY_EDITOR
                if (!string.IsNullOrEmpty(rRequest.AssetName) && !rRequest.IsScene)
                {
                    if (!rRequest.IsLoadAllAssets)
                    {
                        string[] rAssetPaths = UnityEditor.AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(rAssetLoadEntry.ABName, rRequest.AssetName);
                        if (rAssetPaths.Length == 0)
                        {
                            Debug.LogError("There is no asset with name \"" + rRequest.AssetName + "\" in " + rAssetLoadEntry.ABName);
                            yield break;
                        }
                        Object rTargetAsset = UnityEditor.AssetDatabase.LoadMainAssetAtPath(rAssetPaths[0]);
                        rRequest.Asset = rTargetAsset;
                    }
                    else
                    {
                        string[] rAssetPaths = UnityEditor.AssetDatabase.GetAssetPathsFromAssetBundle(rAssetLoadEntry.ABName);
                        if (rAssetPaths.Length == 0)
                        {
                            Debug.LogError("There is no asset with name \"" + rRequest.AssetName + "\" in " + rAssetLoadEntry.ABName);
                            yield break;
                        }
                        rRequest.AllAssets = new Object[rAssetPaths.Length];
                        for (int i = 0; i < rAssetPaths.Length; i++)
                        {
                            Object rAssetObj = UnityEditor.AssetDatabase.LoadAssetAtPath(rAssetPaths[i], typeof(Object));
                            if (rAssetObj != null)
                            {
                                rRequest.AllAssets[i] = rAssetObj;
                            }
                        }
                    }
                }
#endif
            }
            else
            {
                if (bRealLoad)
                {
                    Debug.Log("---Real Load ab: " + rAssetLoadUrl);

                    // 如果是一个直接的资源,将资源的对象取出来
                    var rABCreateRequest = AssetBundle.LoadFromFileAsync(rAssetLoadUrl);
                    yield return(rABCreateRequest);

                    rAssetLoadEntry.CacheAsset = rABCreateRequest.assetBundle;
                }
                else
                {
                    Debug.Log("---Load asset: " + rAssetLoadUrl);
                }

                // 加载Object
                if (!string.IsNullOrEmpty(rRequest.AssetName))
                {
                    if (!rRequest.IsScene)
                    {
                        if (!rRequest.IsLoadAllAssets)
                        {
                            var rABRequest = rAssetLoadEntry.CacheAsset.LoadAssetAsync(rRequest.AssetName);
                            yield return(rABRequest);

                            rRequest.Asset = rABRequest.asset;
                        }
                        else
                        {
                            yield return(LoadAllAssets_ByAssetbundle(rRequest, rAssetLoadEntry.CacheAsset));
                        }
                    }
                    else
                    {
                        rAssetLoadEntry.CacheAsset.GetAllScenePaths();
                    }
                }
            }
        }