private AiukAssetBundleRef SyncGetAssetBundle(AiukAssetInfo assetInfo) { var assetName = assetInfo.AssetName; var appModule = m_ModuleMap[assetInfo.LocModule]; if (AiukAppModuleHelper.GetMainfest(appModule) == null) { AiukDebugUtility.LogError ("Ab主描述文件为空,请确认执行了AssetBundle打包操作!"); return(null); } var manifest = AiukAppModuleHelper.GetMainfest(appModule); var depends = manifest.GetAllDependencies(assetName + ".assetbundle"); foreach (var item in depends) { var bundleName = item.Replace(".assetbundle", ""); if (m_CoreAssetBundleRefs.ContainsKey(bundleName)) { var bundleRef = m_CoreAssetBundleRefs[bundleName]; bundleRef.Use(); } else { var tempInfo = GetAssetInfo(bundleName); var tempAb = AssetBundle.LoadFromFile(tempInfo.ImporterPath); var bundleRef = new AiukAssetBundleRef(tempAb); bundleRef.Use(); m_CoreAssetBundleRefs.Add(bundleName, bundleRef); return(bundleRef); } } var assetBundle = AssetBundle.LoadFromFile(assetInfo.ImporterPath); var newAbRef = new AiukAssetBundleRef(assetBundle); newAbRef.Use(); m_NormalAssetBundleRefs.Add(assetInfo.BundleName, newAbRef); return(newAbRef); }
public AiukAssetLoadResult(T asset, AiukAssetBundleRef bundleRef) { BundleRef = bundleRef; Asset = asset; }