Update runtime code

pull/51/head
hevinci 2022-11-03 10:37:34 +08:00
parent 0844447b46
commit 9db111c08a
2 changed files with 18 additions and 4 deletions

View File

@ -4,7 +4,7 @@ namespace YooAsset
/// <summary>
/// 下载文件校验结果
/// </summary>
public enum EVerifyResult
internal enum EVerifyResult
{
/// <summary>
/// 文件不存在

View File

@ -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;
}
}
}