diff --git a/Assets/YooAsset/Runtime/CacheSystem/EVerifyResult.cs b/Assets/YooAsset/Runtime/CacheSystem/EVerifyResult.cs
index c59e8bc..6d4b48f 100644
--- a/Assets/YooAsset/Runtime/CacheSystem/EVerifyResult.cs
+++ b/Assets/YooAsset/Runtime/CacheSystem/EVerifyResult.cs
@@ -4,7 +4,7 @@ namespace YooAsset
///
/// 下载文件校验结果
///
- public enum EVerifyResult
+ internal enum EVerifyResult
{
///
/// 文件不存在
diff --git a/Assets/YooAsset/Runtime/YooAssetsDriver.cs b/Assets/YooAsset/Runtime/YooAssetsDriver.cs
index bd84663..adb28c2 100644
--- a/Assets/YooAsset/Runtime/YooAssetsDriver.cs
+++ b/Assets/YooAsset/Runtime/YooAssetsDriver.cs
@@ -1,22 +1,36 @@
-using UnityEngine;
+using System.Diagnostics;
+using UnityEngine;
namespace YooAsset
{
internal class YooAssetsDriver : MonoBehaviour
{
+ private static int LastestUpdateFrame = 0;
+
void Update()
{
+ DebugCheckDuplicateDriver();
YooAssets.Update();
}
-
void OnDestroy()
{
YooAssets.Destroy();
}
-
void OnApplicationQuit()
{
YooAssets.Destroy();
}
+
+ [Conditional("DEBUG")]
+ private void DebugCheckDuplicateDriver()
+ {
+ if (LastestUpdateFrame > 0)
+ {
+ if (LastestUpdateFrame == Time.frameCount)
+ YooLogger.Warning($"There are two {nameof(YooAssetsDriver)} in the scene. Please ensure there is always exactly one driver in the scene.");
+ }
+
+ LastestUpdateFrame = Time.frameCount;
+ }
}
}
\ No newline at end of file