protected override IEnumerator LoadAssetAsync() { SEUBundleLoader bundleLoader = m_Pool.GetBundleLoader(m_LoadPath); if (bundleLoader != null) { yield return(bundleLoader.LoadAsync()); if (bundle == null) { bundle = bundleLoader.assetBundle; } else { Debug.LogWarning("[同步冲突] 已经处理"); } } if (bundle != null) { AssetBundleRequest request = bundle.LoadAssetAsync("assetbundlemanifest"); yield return(request); if (m_Asset == null) { m_Asset = request.asset; } } //LogResult(); }
internal SEUBundleLoader GetBundleLoader(string bundleName) { SEUBundleLoader bundleLoader = SEUResources.GetBundleLoader(m_BundleLoaderType); if (bundleLoader != null) { bundleLoader.SetBundleName(bundleName); } return(bundleLoader); }
protected override void LoadAsset() { SEUBundleLoader bundleLoader = m_Pool.GetBundleLoader(m_LoadPath); if (bundleLoader != null) { bundleLoader.Load(); bundle = bundleLoader.assetBundle; } if (bundle != null) { m_Asset = bundle.LoadAsset("assetbundlemanifest"); } //LogResult(); }
protected override IEnumerator LoadAssetAsync() { SEUBundleLoader bundleLoader = m_Pool.GetBundleLoader(m_LoadPath); if (bundleLoader != null) { yield return(bundleLoader.LoadAsync()); if (m_Asset == null) { m_Asset = bundleLoader.assetBundle; } else { Debug.LogWarning("[同步冲突] 已经处理"); } } SEUResources manifestRes = m_Pool.LoadManifest(m_LoadPath); AddDependenceResources(manifestRes); if (manifestRes != null && manifestRes.asset != null) { AssetBundleManifest manifest = manifestRes.asset as AssetBundleManifest; if (manifest != null) { string[] dependenciesPaths = manifest.GetAllDependencies(m_LoadPath); if (dependenciesPaths != null) { for (int i = 0; i < dependenciesPaths.Length; i++) { AsyncRequest request = m_Pool.LoadBundleAsyn(dependenciesPaths[i]); yield return(request); SEUResources depRes = request.resource; AddDependenceResources(depRes); } } } } //LogResult(); }
protected override void LoadAsset() { SEUBundleLoader bundleLoader = m_Pool.GetBundleLoader(m_LoadPath); if (bundleLoader != null) { bundleLoader.Load(); if (m_Asset == null) { m_Asset = bundleLoader.assetBundle; } else { Debug.LogWarning("[异步冲突]"); } } SEUResources manifestRes = m_Pool.LoadManifest(m_LoadPath); AddDependenceResources(manifestRes); if (manifestRes != null && manifestRes.asset != null) { AssetBundleManifest manifest = manifestRes.asset as AssetBundleManifest; if (manifest != null) { string[] dependenciesPaths = manifest.GetAllDependencies(m_LoadPath); if (dependenciesPaths != null) { for (int i = 0; i < dependenciesPaths.Length; i++) { SEUResources depRes = m_Pool.LoadBundle(dependenciesPaths[i]); AddDependenceResources(depRes); } } } } //LogResult(); }
public static SEUBundleLoader GetBundleLoader(SEUBundleLoaderType bundleLoaderType) { SEUBundleLoader bundleLoader = null; switch (bundleLoaderType) { case SEUBundleLoaderType.Defualt_Memory_BundleLoader: bundleLoader = new SEUBundleLoaderFromMemory(); break; case SEUBundleLoaderType.Defualt_FromFile_BundleLoader: bundleLoader = new SEUBundleLoaderFromFile(); break; case SEUBundleLoaderType.DGM_BundleLoader: bundleLoader = new DGMBundleLoader(); break; default: Debug.LogError("Can not find BundleLoader"); break; } return(bundleLoader); }