Update runtime code
parent
0844447b46
commit
9db111c08a
|
@ -4,7 +4,7 @@ namespace YooAsset
|
|||
/// <summary>
|
||||
/// 下载文件校验结果
|
||||
/// </summary>
|
||||
public enum EVerifyResult
|
||||
internal enum EVerifyResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件不存在
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue