mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Init TEngine4.0.0
Init TEngine4.0.0
This commit is contained in:
28
UnityProject/Packages/YooAsset/Runtime/YooAssetsDriver.cs
Normal file
28
UnityProject/Packages/YooAsset/Runtime/YooAssetsDriver.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Diagnostics;
|
||||
using UnityEngine;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
internal class YooAssetsDriver : MonoBehaviour
|
||||
{
|
||||
private static int LastestUpdateFrame = 0;
|
||||
|
||||
void Update()
|
||||
{
|
||||
DebugCheckDuplicateDriver();
|
||||
YooAssets.Update();
|
||||
}
|
||||
|
||||
[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