diff --git a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs
index 8be7f14..a1feec7 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/AssetSystem.cs
@@ -20,7 +20,7 @@ namespace YooAsset
///
public static int AssetLoadingMaxNumber { private set; get; }
- public static IDecryptServices DecryptServices { private set; get; }
+ public static IDecryptionServices DecryptionServices { private set; get; }
public static IBundleServices BundleServices { private set; get; }
@@ -28,11 +28,11 @@ namespace YooAsset
/// 初始化资源系统
/// 注意:在使用AssetSystem之前需要初始化
///
- public static void Initialize(bool simulationOnEditor, int assetLoadingMaxNumber, IDecryptServices decryptServices, IBundleServices bundleServices)
+ public static void Initialize(bool simulationOnEditor, int assetLoadingMaxNumber, IDecryptionServices decryptionServices, IBundleServices bundleServices)
{
SimulationOnEditor = simulationOnEditor;
AssetLoadingMaxNumber = assetLoadingMaxNumber;
- DecryptServices = decryptServices;
+ DecryptionServices = decryptionServices;
BundleServices = bundleServices;
}
@@ -307,7 +307,7 @@ namespace YooAsset
DebugSummy.DebugProviderInfo providerInfo = new DebugSummy.DebugProviderInfo();
providerInfo.AssetPath = provider.AssetPath;
providerInfo.RefCount = provider.RefCount;
- providerInfo.States = (int)provider.States;
+ providerInfo.Status = (int)provider.Status;
providerInfo.BundleInfos.Clear();
summy.ProviderInfos.Add(providerInfo);
diff --git a/Assets/YooAsset/Runtime/AssetSystem/EDecryptMethod.cs b/Assets/YooAsset/Runtime/AssetSystem/EDecryptMethod.cs
deleted file mode 100644
index 0c4c1d7..0000000
--- a/Assets/YooAsset/Runtime/AssetSystem/EDecryptMethod.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-
-namespace YooAsset
-{
- ///
- /// 解密方法
- ///
- public enum EDecryptMethod
- {
- ///
- /// 获取解密的数据偏移
- ///
- GetDecryptOffset,
-
- ///
- /// 获取解密的字节数据
- ///
- GetDecryptBinary,
- }
-}
\ No newline at end of file
diff --git a/Assets/YooAsset/Runtime/AssetSystem/EDecryptMethod.cs.meta b/Assets/YooAsset/Runtime/AssetSystem/EDecryptMethod.cs.meta
deleted file mode 100644
index ea68fc6..0000000
--- a/Assets/YooAsset/Runtime/AssetSystem/EDecryptMethod.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 6a446add12cd4554a9bd178a7ef2db55
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/YooAsset/Runtime/AssetSystem/IDecryptServices.cs b/Assets/YooAsset/Runtime/AssetSystem/IDecryptServices.cs
deleted file mode 100644
index 4cca90d..0000000
--- a/Assets/YooAsset/Runtime/AssetSystem/IDecryptServices.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-
-namespace YooAsset
-{
- public interface IDecryptServices
- {
- EDecryptMethod DecryptType { get; }
-
- ///
- /// 获取解密的数据偏移
- ///
- ulong GetDecryptOffset(BundleInfo bundleInfo);
-
- ///
- /// 获取解密的字节数据
- ///
- byte[] GetDecryptBinary(BundleInfo bundleInfo);
- }
-}
\ No newline at end of file
diff --git a/Assets/YooAsset/Runtime/AssetSystem/IDecryptionServices.cs b/Assets/YooAsset/Runtime/AssetSystem/IDecryptionServices.cs
new file mode 100644
index 0000000..58434f7
--- /dev/null
+++ b/Assets/YooAsset/Runtime/AssetSystem/IDecryptionServices.cs
@@ -0,0 +1,11 @@
+
+namespace YooAsset
+{
+ public interface IDecryptionServices
+ {
+ ///
+ /// 获取加密文件的数据偏移量
+ ///
+ ulong GetFileOffset(BundleInfo bundleInfo);
+ }
+}
\ No newline at end of file
diff --git a/Assets/YooAsset/Runtime/AssetSystem/IDecryptServices.cs.meta b/Assets/YooAsset/Runtime/AssetSystem/IDecryptionServices.cs.meta
similarity index 100%
rename from Assets/YooAsset/Runtime/AssetSystem/IDecryptServices.cs.meta
rename to Assets/YooAsset/Runtime/AssetSystem/IDecryptionServices.cs.meta
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleFileLoader.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleFileLoader.cs
index d5299b7..8f9d1e4 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleFileLoader.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Loader/BundleFileLoader.cs
@@ -7,6 +7,17 @@ namespace YooAsset
{
internal class BundleFileLoader
{
+ public enum EStatus
+ {
+ None = 0,
+ Download,
+ CheckDownload,
+ LoadFile,
+ CheckFile,
+ Success,
+ Fail,
+ }
+
///
/// 资源包文件信息
///
@@ -20,7 +31,7 @@ namespace YooAsset
///
/// 加载状态
///
- public ELoaderStates States { private set; get; }
+ public EStatus Status { private set; get; }
///
/// 是否已经销毁
@@ -33,13 +44,13 @@ namespace YooAsset
private FileDownloader _fileDownloader;
private AssetBundleCreateRequest _cacheRequest;
internal AssetBundle CacheBundle { private set; get; }
-
+
public BundleFileLoader(BundleInfo bundleInfo)
{
BundleFileInfo = bundleInfo;
RefCount = 0;
- States = ELoaderStates.None;
+ Status = EStatus.None;
}
///
@@ -89,31 +100,31 @@ namespace YooAsset
if (IsDone())
return;
- if (States == ELoaderStates.None)
+ if (Status == EStatus.None)
{
// 检测加载地址是否为空
if (string.IsNullOrEmpty(BundleFileInfo.LocalPath))
{
- States = ELoaderStates.Fail;
+ Status = EStatus.Fail;
return;
}
if (string.IsNullOrEmpty(BundleFileInfo.RemoteMainURL))
- States = ELoaderStates.LoadFile;
+ Status = EStatus.LoadFile;
else
- States = ELoaderStates.Download;
+ Status = EStatus.Download;
}
// 1. 从服务器下载
- if (States == ELoaderStates.Download)
+ if (Status == EStatus.Download)
{
int failedTryAgain = int.MaxValue;
_fileDownloader = DownloadSystem.BeginDownload(BundleFileInfo, failedTryAgain);
- States = ELoaderStates.CheckDownload;
+ Status = EStatus.CheckDownload;
}
// 2. 检测服务器下载结果
- if (States == ELoaderStates.CheckDownload)
+ if (Status == EStatus.CheckDownload)
{
if (_fileDownloader.IsDone() == false)
return;
@@ -121,23 +132,23 @@ namespace YooAsset
if (_fileDownloader.HasError())
{
_fileDownloader.ReportError();
- States = ELoaderStates.Fail;
+ Status = EStatus.Fail;
}
else
{
- States = ELoaderStates.LoadFile;
+ Status = EStatus.LoadFile;
}
}
// 3. 加载AssetBundle
- if (States == ELoaderStates.LoadFile)
+ if (Status == EStatus.LoadFile)
{
#if UNITY_EDITOR
// 注意:Unity2017.4编辑器模式下,如果AssetBundle文件不存在会导致编辑器崩溃,这里做了预判。
if (System.IO.File.Exists(BundleFileInfo.LocalPath) == false)
{
YooLogger.Warning($"Not found assetBundle file : {BundleFileInfo.LocalPath}");
- States = ELoaderStates.Fail;
+ Status = EStatus.Fail;
return;
}
#endif
@@ -145,30 +156,14 @@ namespace YooAsset
// Load assetBundle file
if (BundleFileInfo.IsEncrypted)
{
- if (AssetSystem.DecryptServices == null)
+ if (AssetSystem.DecryptionServices == null)
throw new Exception($"{nameof(BundleFileLoader)} need IDecryptServices : {BundleFileInfo.BundleName}");
- EDecryptMethod decryptType = AssetSystem.DecryptServices.DecryptType;
- if (decryptType == EDecryptMethod.GetDecryptOffset)
- {
- ulong offset = AssetSystem.DecryptServices.GetDecryptOffset(BundleFileInfo);
- if (_isWaitForAsyncComplete)
- CacheBundle = AssetBundle.LoadFromFile(BundleFileInfo.LocalPath, 0, offset);
- else
- _cacheRequest = AssetBundle.LoadFromFileAsync(BundleFileInfo.LocalPath, 0, offset);
- }
- else if (decryptType == EDecryptMethod.GetDecryptBinary)
- {
- byte[] binary = AssetSystem.DecryptServices.GetDecryptBinary(BundleFileInfo);
- if (_isWaitForAsyncComplete)
- CacheBundle = AssetBundle.LoadFromMemory(binary);
- else
- _cacheRequest = AssetBundle.LoadFromMemoryAsync(binary);
- }
+ ulong offset = AssetSystem.DecryptionServices.GetFileOffset(BundleFileInfo);
+ if (_isWaitForAsyncComplete)
+ CacheBundle = AssetBundle.LoadFromFile(BundleFileInfo.LocalPath, 0, offset);
else
- {
- throw new NotImplementedException($"{decryptType}");
- }
+ _cacheRequest = AssetBundle.LoadFromFileAsync(BundleFileInfo.LocalPath, 0, offset);
}
else
{
@@ -177,11 +172,11 @@ namespace YooAsset
else
_cacheRequest = AssetBundle.LoadFromFileAsync(BundleFileInfo.LocalPath);
}
- States = ELoaderStates.CheckFile;
+ Status = EStatus.CheckFile;
}
// 4. 检测AssetBundle加载结果
- if (States == ELoaderStates.CheckFile)
+ if (Status == EStatus.CheckFile)
{
if (_cacheRequest != null)
{
@@ -203,11 +198,11 @@ namespace YooAsset
if (CacheBundle == null)
{
YooLogger.Error($"Failed to load assetBundle file : {BundleFileInfo.BundleName}");
- States = ELoaderStates.Fail;
+ Status = EStatus.Fail;
}
else
{
- States = ELoaderStates.Success;
+ Status = EStatus.Success;
}
}
}
@@ -240,7 +235,7 @@ namespace YooAsset
///
public bool IsDone()
{
- return States == ELoaderStates.Success || States == ELoaderStates.Fail;
+ return Status == EStatus.Success || Status == EStatus.Fail;
}
///
@@ -302,7 +297,7 @@ namespace YooAsset
if (_isShowWaitForAsyncError == false)
{
_isShowWaitForAsyncError = true;
- YooLogger.Error($"WaitForAsyncComplete failed ! BundleName : {BundleFileInfo.BundleName} States : {States}");
+ YooLogger.Error($"WaitForAsyncComplete failed ! BundleName : {BundleFileInfo.BundleName} States : {Status}");
}
break;
}
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs
index 9176d05..2e090c6 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Loader/DependBundleGrouper.cs
@@ -74,7 +74,7 @@ namespace YooAsset
debugInfo.BundleName = loader.BundleFileInfo.BundleName;
debugInfo.Version = loader.BundleFileInfo.Version;
debugInfo.RefCount = loader.RefCount;
- debugInfo.States = (int)loader.States;
+ debugInfo.Status = (int)loader.Status;
output.Add(debugInfo);
}
}
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/ELoaderStates.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/ELoaderStates.cs
deleted file mode 100644
index d9b91fe..0000000
--- a/Assets/YooAsset/Runtime/AssetSystem/Loader/ELoaderStates.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-
-namespace YooAsset
-{
- ///
- /// 文件加载器状态
- ///
- public enum ELoaderStates
- {
- None = 0,
- Download,
- CheckDownload,
- LoadFile,
- CheckFile,
- Success,
- Fail,
- }
-}
\ No newline at end of file
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/ELoaderStates.cs.meta b/Assets/YooAsset/Runtime/AssetSystem/Loader/ELoaderStates.cs.meta
deleted file mode 100644
index 3674a8a..0000000
--- a/Assets/YooAsset/Runtime/AssetSystem/Loader/ELoaderStates.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 90f00fe388279034aaee9c89c07e2ef1
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Operations.meta b/Assets/YooAsset/Runtime/AssetSystem/Operations.meta
new file mode 100644
index 0000000..f43acf5
--- /dev/null
+++ b/Assets/YooAsset/Runtime/AssetSystem/Operations.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: fcfac83df022948478c32bf11b8e0987
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/YooAsset/Runtime/AssetSystem/AssetOperationHandle.cs b/Assets/YooAsset/Runtime/AssetSystem/Operations/AssetOperationHandle.cs
similarity index 90%
rename from Assets/YooAsset/Runtime/AssetSystem/AssetOperationHandle.cs
rename to Assets/YooAsset/Runtime/AssetSystem/Operations/AssetOperationHandle.cs
index bb26d9b..13e8a64 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/AssetOperationHandle.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Operations/AssetOperationHandle.cs
@@ -24,15 +24,20 @@ namespace YooAsset
}
///
- /// 当前的加载状态
+ /// 当前状态
///
- public EAssetStates States
+ public EOperationStatus Status
{
get
{
if (IsValid == false)
- return EAssetStates.None;
- return _provider.States;
+ return EOperationStatus.None;
+ if (_provider.Status == AssetProviderBase.EStatus.Fail)
+ return EOperationStatus.Failed;
+ else if (_provider.Status == AssetProviderBase.EStatus.Success)
+ return EOperationStatus.Succeed;
+ else
+ return EOperationStatus.None;
}
}
diff --git a/Assets/YooAsset/Runtime/AssetSystem/AssetOperationHandle.cs.meta b/Assets/YooAsset/Runtime/AssetSystem/Operations/AssetOperationHandle.cs.meta
similarity index 100%
rename from Assets/YooAsset/Runtime/AssetSystem/AssetOperationHandle.cs.meta
rename to Assets/YooAsset/Runtime/AssetSystem/Operations/AssetOperationHandle.cs.meta
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/AssetProviderBase.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/AssetProviderBase.cs
index 96d1d16..6d0809a 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Provider/AssetProviderBase.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/AssetProviderBase.cs
@@ -3,6 +3,16 @@ namespace YooAsset
{
internal abstract class AssetProviderBase : IAssetProvider
{
+ public enum EStatus
+ {
+ None = 0,
+ CheckBundle,
+ Loading,
+ Checking,
+ Success,
+ Fail,
+ }
+
protected bool IsWaitForAsyncComplete { private set; get; } = false;
public string AssetPath { private set; get; }
@@ -11,7 +21,7 @@ namespace YooAsset
public UnityEngine.Object AssetObject { protected set; get; }
public UnityEngine.Object[] AllAssets { protected set; get; }
public IAssetInstance AssetInstance { protected set; get; }
- public EAssetStates States { protected set; get; }
+ public EStatus Status { protected set; get; }
public int RefCount { private set; get; }
public AssetOperationHandle Handle { private set; get; }
public System.Action Callback { set; get; }
@@ -20,7 +30,7 @@ namespace YooAsset
{
get
{
- return States == EAssetStates.Success || States == EAssetStates.Fail;
+ return Status == EStatus.Success || Status == EStatus.Fail;
}
}
public bool IsValid
@@ -44,7 +54,7 @@ namespace YooAsset
AssetPath = assetPath;
AssetName = System.IO.Path.GetFileName(assetPath);
AssetType = assetType;
- States = EAssetStates.None;
+ Status = EStatus.None;
Handle = new AssetOperationHandle(this);
}
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledAssetProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledAssetProvider.cs
index 9dddcb3..ca2c521 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledAssetProvider.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledAssetProvider.cs
@@ -26,13 +26,13 @@ namespace YooAsset
if (IsDone)
return;
- if (States == EAssetStates.None)
+ if (Status == EStatus.None)
{
- States = EAssetStates.CheckBundle;
+ Status = EStatus.CheckBundle;
}
// 1. 检测资源包
- if (States == EAssetStates.CheckBundle)
+ if (Status == EStatus.CheckBundle)
{
if (IsWaitForAsyncComplete)
{
@@ -47,17 +47,17 @@ namespace YooAsset
if (OwnerBundle.CacheBundle == null)
{
- States = EAssetStates.Fail;
+ Status = EStatus.Fail;
InvokeCompletion();
}
else
{
- States = EAssetStates.Loading;
+ Status = EStatus.Loading;
}
}
// 2. 加载资源对象
- if (States == EAssetStates.Loading)
+ if (Status == EStatus.Loading)
{
if (IsWaitForAsyncComplete)
{
@@ -73,11 +73,11 @@ namespace YooAsset
else
_cacheRequest = OwnerBundle.CacheBundle.LoadAssetAsync(AssetName, AssetType);
}
- States = EAssetStates.Checking;
+ Status = EStatus.Checking;
}
// 3. 检测加载结果
- if (States == EAssetStates.Checking)
+ if (Status == EStatus.Checking)
{
if (_cacheRequest != null)
{
@@ -95,8 +95,8 @@ namespace YooAsset
}
}
- States = AssetObject == null ? EAssetStates.Fail : EAssetStates.Success;
- if (States == EAssetStates.Fail)
+ Status = AssetObject == null ? EStatus.Fail : EStatus.Success;
+ if (Status == EStatus.Fail)
YooLogger.Warning($"Failed to load asset : {AssetName} from bundle : {OwnerBundle.BundleFileInfo.BundleName}");
InvokeCompletion();
}
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs
index 1a26259..610b950 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledProvider.cs
@@ -42,7 +42,7 @@ namespace YooAsset
ownerInfo.BundleName = OwnerBundle.BundleFileInfo.BundleName;
ownerInfo.Version = OwnerBundle.BundleFileInfo.Version;
ownerInfo.RefCount = OwnerBundle.RefCount;
- ownerInfo.States = (int)OwnerBundle.States;
+ ownerInfo.Status = (int)OwnerBundle.Status;
output.Add(ownerInfo);
DependBundles.GetBundleDebugInfos(output);
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSceneProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSceneProvider.cs
index 69afe9c..5236f25 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSceneProvider.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSceneProvider.cs
@@ -29,13 +29,13 @@ namespace YooAsset
if (IsDone)
return;
- if (States == EAssetStates.None)
+ if (Status == EStatus.None)
{
- States = EAssetStates.CheckBundle;
+ Status = EStatus.CheckBundle;
}
// 1. 检测资源包
- if (States == EAssetStates.CheckBundle)
+ if (Status == EStatus.CheckBundle)
{
if (DependBundles.IsDone() == false)
return;
@@ -44,34 +44,34 @@ namespace YooAsset
if (OwnerBundle.CacheBundle == null)
{
- States = EAssetStates.Fail;
+ Status = EStatus.Fail;
InvokeCompletion();
}
else
{
- States = EAssetStates.Loading;
+ Status = EStatus.Loading;
}
}
// 2. 加载场景
- if (States == EAssetStates.Loading)
+ if (Status == EStatus.Loading)
{
_asyncOp = SceneManager.LoadSceneAsync(AssetName, _param.LoadMode);
if (_asyncOp != null)
{
_asyncOp.allowSceneActivation = true;
- States = EAssetStates.Checking;
+ Status = EStatus.Checking;
}
else
{
YooLogger.Warning($"Failed to load scene : {AssetName}");
- States = EAssetStates.Fail;
+ Status = EStatus.Fail;
InvokeCompletion();
}
}
// 3. 检测加载结果
- if (States == EAssetStates.Checking)
+ if (Status == EStatus.Checking)
{
if (_asyncOp.isDone)
{
@@ -81,7 +81,7 @@ namespace YooAsset
if (_param.ActivateOnLoad)
instance.Activate();
- States = instance.Scene.IsValid() ? EAssetStates.Success : EAssetStates.Fail;
+ Status = instance.Scene.IsValid() ? EStatus.Success : EStatus.Fail;
InvokeCompletion();
}
}
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSubAssetsProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSubAssetsProvider.cs
index 0114db5..849cb5e 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSubAssetsProvider.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSubAssetsProvider.cs
@@ -26,13 +26,13 @@ namespace YooAsset
if (IsDone)
return;
- if (States == EAssetStates.None)
+ if (Status == EStatus.None)
{
- States = EAssetStates.CheckBundle;
+ Status = EStatus.CheckBundle;
}
// 1. 检测资源包
- if (States == EAssetStates.CheckBundle)
+ if (Status == EStatus.CheckBundle)
{
if (IsWaitForAsyncComplete)
{
@@ -47,17 +47,17 @@ namespace YooAsset
if (OwnerBundle.CacheBundle == null)
{
- States = EAssetStates.Fail;
+ Status = EStatus.Fail;
InvokeCompletion();
}
else
{
- States = EAssetStates.Loading;
+ Status = EStatus.Loading;
}
}
// 2. 加载资源对象
- if (States == EAssetStates.Loading)
+ if (Status == EStatus.Loading)
{
if (IsWaitForAsyncComplete)
{
@@ -73,11 +73,11 @@ namespace YooAsset
else
_cacheRequest = OwnerBundle.CacheBundle.LoadAssetWithSubAssetsAsync(AssetName, AssetType);
}
- States = EAssetStates.Checking;
+ Status = EStatus.Checking;
}
// 3. 检测加载结果
- if (States == EAssetStates.Checking)
+ if (Status == EStatus.Checking)
{
if (_cacheRequest != null)
{
@@ -95,8 +95,8 @@ namespace YooAsset
}
}
- States = AllAssets == null ? EAssetStates.Fail : EAssetStates.Success;
- if (States == EAssetStates.Fail)
+ Status = AllAssets == null ? EStatus.Fail : EStatus.Success;
+ if (Status == EStatus.Fail)
YooLogger.Warning($"Failed to load sub assets : {AssetName} from bundle : {OwnerBundle.BundleFileInfo.BundleName}");
InvokeCompletion();
}
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseAssetProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseAssetProvider.cs
index 9b2f1ab..eab4f90 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseAssetProvider.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseAssetProvider.cs
@@ -27,19 +27,19 @@ namespace YooAsset
if (IsDone)
return;
- if (States == EAssetStates.None)
+ if (Status == EStatus.None)
{
// 检测资源文件是否存在
string guid = UnityEditor.AssetDatabase.AssetPathToGUID(AssetPath);
if (string.IsNullOrEmpty(guid))
{
- States = EAssetStates.Fail;
+ Status = EStatus.Fail;
InvokeCompletion();
return;
}
else
{
- States = EAssetStates.Loading;
+ Status = EStatus.Loading;
}
// 注意:模拟异步加载效果提前返回
@@ -48,17 +48,17 @@ namespace YooAsset
}
// 1. 加载资源对象
- if (States == EAssetStates.Loading)
+ if (Status == EStatus.Loading)
{
AssetObject = UnityEditor.AssetDatabase.LoadAssetAtPath(AssetPath, AssetType);
- States = EAssetStates.Checking;
+ Status = EStatus.Checking;
}
// 2. 检测加载结果
- if (States == EAssetStates.Checking)
+ if (Status == EStatus.Checking)
{
- States = AssetObject == null ? EAssetStates.Fail : EAssetStates.Success;
- if (States == EAssetStates.Fail)
+ Status = AssetObject == null ? EStatus.Fail : EStatus.Success;
+ if (Status == EStatus.Fail)
YooLogger.Warning($"Failed to load asset object : {AssetPath}");
InvokeCompletion();
}
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseSceneProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseSceneProvider.cs
index d52fb8d..a92b1ef 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseSceneProvider.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseSceneProvider.cs
@@ -28,13 +28,13 @@ namespace YooAsset
if (IsDone)
return;
- if (States == EAssetStates.None)
+ if (Status == EStatus.None)
{
- States = EAssetStates.Loading;
+ Status = EStatus.Loading;
}
// 1. 加载资源对象
- if (States == EAssetStates.Loading)
+ if (Status == EStatus.Loading)
{
LoadSceneParameters loadSceneParameters = new LoadSceneParameters();
loadSceneParameters.loadSceneMode = _param.LoadMode;
@@ -42,18 +42,18 @@ namespace YooAsset
if (_asyncOp != null)
{
_asyncOp.allowSceneActivation = true;
- States = EAssetStates.Checking;
+ Status = EStatus.Checking;
}
else
{
YooLogger.Warning($"Failed to load scene : {AssetName}");
- States = EAssetStates.Fail;
+ Status = EStatus.Fail;
InvokeCompletion();
}
}
// 2. 检测加载结果
- if (States == EAssetStates.Checking)
+ if (Status == EStatus.Checking)
{
if (_asyncOp.isDone)
{
@@ -63,7 +63,7 @@ namespace YooAsset
if(_param.ActivateOnLoad)
instance.Activate();
- States = instance.Scene.IsValid() ? EAssetStates.Success : EAssetStates.Fail;
+ Status = instance.Scene.IsValid() ? EStatus.Success : EStatus.Fail;
InvokeCompletion();
}
}
diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseSubAssetsProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseSubAssetsProvider.cs
index 9fa14e4..068e27b 100644
--- a/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseSubAssetsProvider.cs
+++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/DatabaseSubAssetsProvider.cs
@@ -27,19 +27,19 @@ namespace YooAsset
if (IsDone)
return;
- if (States == EAssetStates.None)
+ if (Status == EStatus.None)
{
// 检测资源文件是否存在
string guid = UnityEditor.AssetDatabase.AssetPathToGUID(AssetPath);
if (string.IsNullOrEmpty(guid))
{
- States = EAssetStates.Fail;
+ Status = EStatus.Fail;
InvokeCompletion();
return;
}
else
{
- States = EAssetStates.Loading;
+ Status = EStatus.Loading;
}
// 注意:模拟异步加载效果提前返回
@@ -48,7 +48,7 @@ namespace YooAsset
}
// 1. 加载资源对象
- if (States == EAssetStates.Loading)
+ if (Status == EStatus.Loading)
{
var findAssets = UnityEditor.AssetDatabase.LoadAllAssetsAtPath(AssetPath);
List result = new List