mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-26 10:40:14 +00:00
Update runtime code
This commit is contained in:
@@ -4,7 +4,7 @@ namespace YooAsset
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 下载文件校验结果
|
/// 下载文件校验结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum EVerifyResult
|
internal enum EVerifyResult
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 文件不存在
|
/// 文件不存在
|
||||||
|
|||||||
@@ -1,22 +1,36 @@
|
|||||||
using UnityEngine;
|
using System.Diagnostics;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace YooAsset
|
namespace YooAsset
|
||||||
{
|
{
|
||||||
internal class YooAssetsDriver : MonoBehaviour
|
internal class YooAssetsDriver : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
private static int LastestUpdateFrame = 0;
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
DebugCheckDuplicateDriver();
|
||||||
YooAssets.Update();
|
YooAssets.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDestroy()
|
void OnDestroy()
|
||||||
{
|
{
|
||||||
YooAssets.Destroy();
|
YooAssets.Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnApplicationQuit()
|
void OnApplicationQuit()
|
||||||
{
|
{
|
||||||
YooAssets.Destroy();
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user