diff --git a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs index 46f3055..a58c023 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs @@ -8,7 +8,7 @@ namespace YooAsset { internal static class AssetSystem { - private static readonly List _loaders = new List(1000); + private static readonly List _loaders = new List(1000); private static readonly List _providers = new List(1000); /// @@ -90,12 +90,12 @@ namespace YooAsset { for (int i = _loaders.Count - 1; i >= 0; i--) { - BundleFileLoader loader = _loaders[i]; + AssetBundleLoader loader = _loaders[i]; loader.TryDestroyAllProviders(); } for (int i = _loaders.Count - 1; i >= 0; i--) { - BundleFileLoader loader = _loaders[i]; + AssetBundleLoader loader = _loaders[i]; if (loader.CanDestroy()) { loader.Destroy(false); @@ -179,22 +179,22 @@ namespace YooAsset } - internal static BundleFileLoader CreateOwnerBundleLoader(string assetPath) + internal static AssetBundleLoader CreateOwnerAssetBundleLoader(string assetPath) { string bundleName = BundleServices.GetBundleName(assetPath); BundleInfo bundleInfo = BundleServices.GetBundleInfo(bundleName); - return CreateBundleFileLoaderInternal(bundleInfo); + return CreateAssetBundleLoaderInternal(bundleInfo); } - internal static List CreateDependBundleLoaders(string assetPath) + internal static List CreateDependAssetBundleLoaders(string assetPath) { - List result = new List(); + List result = new List(); string[] depends = BundleServices.GetAllDependencies(assetPath); if (depends != null) { foreach (var dependBundleName in depends) { BundleInfo dependBundleInfo = BundleServices.GetBundleInfo(dependBundleName); - BundleFileLoader dependLoader = CreateBundleFileLoaderInternal(dependBundleInfo); + AssetBundleLoader dependLoader = CreateAssetBundleLoaderInternal(dependBundleInfo); result.Add(dependLoader); } } @@ -208,24 +208,24 @@ namespace YooAsset } } - private static BundleFileLoader CreateBundleFileLoaderInternal(BundleInfo bundleInfo) + private static AssetBundleLoader CreateAssetBundleLoaderInternal(BundleInfo bundleInfo) { // 如果加载器已经存在 - BundleFileLoader loader = TryGetBundleFileLoader(bundleInfo.BundleName); + AssetBundleLoader loader = TryGetAssetBundleLoader(bundleInfo.BundleName); if (loader != null) return loader; // 新增下载需求 - loader = new BundleFileLoader(bundleInfo); + loader = new AssetBundleLoader(bundleInfo); _loaders.Add(loader); return loader; } - private static BundleFileLoader TryGetBundleFileLoader(string bundleName) + private static AssetBundleLoader TryGetAssetBundleLoader(string bundleName) { - BundleFileLoader loader = null; + AssetBundleLoader loader = null; for (int i = 0; i < _loaders.Count; i++) { - BundleFileLoader temp = _loaders[i]; + AssetBundleLoader temp = _loaders[i]; if (temp.BundleFileInfo.BundleName.Equals(bundleName)) { loader = temp; diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleFileLoader.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleLoader.cs similarity index 97% rename from Assets/YooAsset/Runtime/AssetSystem/Loader/BundleFileLoader.cs rename to Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleLoader.cs index e61ce10..1561d11 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleFileLoader.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleLoader.cs @@ -5,7 +5,7 @@ using UnityEngine; namespace YooAsset { - internal class BundleFileLoader + internal class AssetBundleLoader { public enum EStatus { @@ -46,7 +46,7 @@ namespace YooAsset internal AssetBundle CacheBundle { private set; get; } - public BundleFileLoader(BundleInfo bundleInfo) + public AssetBundleLoader(BundleInfo bundleInfo) { BundleFileInfo = bundleInfo; RefCount = 0; @@ -157,7 +157,7 @@ namespace YooAsset if (BundleFileInfo.IsEncrypted) { if (AssetSystem.DecryptionServices == null) - throw new Exception($"{nameof(BundleFileLoader)} need IDecryptServices : {BundleFileInfo.BundleName}"); + throw new Exception($"{nameof(AssetBundleLoader)} need IDecryptServices : {BundleFileInfo.BundleName}"); ulong offset = AssetSystem.DecryptionServices.GetFileOffset(BundleFileInfo); if (_isWaitForAsyncComplete) diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleFileLoader.cs.meta b/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleLoader.cs.meta similarity index 100% rename from Assets/YooAsset/Runtime/AssetSystem/Loader/BundleFileLoader.cs.meta rename to Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleLoader.cs.meta diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/DependAssetBundleGrouper.cs similarity index 86% rename from Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs rename to Assets/YooAsset/Runtime/AssetSystem/Loader/DependAssetBundleGrouper.cs index 0557a0a..46c3b0c 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Loader/DependAssetBundleGrouper.cs @@ -4,16 +4,16 @@ using System.Collections.Generic; namespace YooAsset { - internal class DependBundleGrouper + internal class DependAssetBundleGrouper { /// /// 依赖的资源包加载器列表 /// - private readonly List _dependBundles; + private readonly List _dependBundles; - public DependBundleGrouper(string assetPath) + public DependAssetBundleGrouper(string assetPath) { - _dependBundles = AssetSystem.CreateDependBundleLoaders(assetPath); + _dependBundles = AssetSystem.CreateDependAssetBundleLoaders(assetPath); } /// diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs.meta b/Assets/YooAsset/Runtime/AssetSystem/Loader/DependAssetBundleGrouper.cs.meta similarity index 100% rename from Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs.meta rename to Assets/YooAsset/Runtime/AssetSystem/Loader/DependAssetBundleGrouper.cs.meta diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs index 2c6610c..bc77fb1 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs @@ -5,15 +5,15 @@ namespace YooAsset { internal abstract class BundledProvider : ProviderBase { - protected BundleFileLoader OwnerBundle { private set; get; } - protected DependBundleGrouper DependBundles { private set; get; } + protected AssetBundleLoader OwnerBundle { private set; get; } + protected DependAssetBundleGrouper DependBundles { private set; get; } public BundledProvider(string assetPath, System.Type assetType) : base(assetPath, assetType) { - OwnerBundle = AssetSystem.CreateOwnerBundleLoader(assetPath); + OwnerBundle = AssetSystem.CreateOwnerAssetBundleLoader(assetPath); OwnerBundle.Reference(); OwnerBundle.AddProvider(this); - DependBundles = new DependBundleGrouper(assetPath); + DependBundles = new DependAssetBundleGrouper(assetPath); DependBundles.Reference(); } public override void Destory()