/// <summary> /// 加载主资源 /// </summary> /// <param name="assetCategory">资源分类</param> /// <param name="assetFullName"></param> /// <param name="onComplete"></param> public void LoadMainAsset(AssetCategory assetCategory, string assetFullName, BaseAction <ResourceEntity> onComplete = null) { MainAssetLoaderRoutine routine = GameEntry.Pool.DequeueClassObject <MainAssetLoaderRoutine>(); routine.load(assetCategory, assetFullName, (ResourceEntity resEntity) => { if (onComplete != null) { onComplete(resEntity); } }); }
/// <summary> /// 加载依赖资源 /// </summary> private void LoadDependsAsset() { List <AssetDependsEntity> lst = m_CurrAssetEntity.DependsAssetList; if (lst != null) { int len = lst.Count; m_NeedLoadAssetDependCount = len; for (int i = 0; i < len; i++) { AssetDependsEntity entity = lst[i]; MainAssetLoaderRoutine routine = GameEntry.Pool.DequeueClassObject <MainAssetLoaderRoutine>(); routine.load(entity.Category, entity.AssetFullName, OnLoadDependsAssetComplete); } } else { //这个资源没有依赖 直接加载主资源 LoadMainAsset(); } }