internal SEUResources LoadBundle(string path, bool isNeedConvertBundlePath = false) { string bundlePath = path; if (isNeedConvertBundlePath) { bundlePath = m_ResourceToBundlePathConverter.HandlePath(path); } System.Type type = typeof(AssetBundle); int resGUID = ToResGUID(bundlePath, type); SEUResources resource = null; if (m_AssetBundles.ContainsKey(resGUID)) { resource = m_AssetBundles[resGUID]; /// 这样处理 为了同步和异步并存 if (resource.asset == null) { resource.LoadAsset(); } } else { resource = new SEUResourcesBundle(bundlePath, type); PushResource(resource); resource.LoadAsset(); } return(resource); }
internal AsyncRequest LoadBundleAsyn(string path, bool isNeedConvertBundlePath = false) { string bundlePath = path; if (isNeedConvertBundlePath) { bundlePath = m_ResourceToBundlePathConverter.HandlePath(path); } System.Type type = typeof(AssetBundle); int resGUID = ToResGUID(bundlePath, type); SEUResources resource = null; if (m_AssetBundles.ContainsKey(resGUID)) { resource = m_AssetBundles[resGUID]; } else { resource = new SEUResourcesBundle(bundlePath, type); PushResource(resource); } return(resource.SendLoadAsyncRequest()); }