更新Demo

更新Demo
This commit is contained in:
ALEXTANG
2023-12-20 12:14:27 +08:00
parent f64bb37706
commit 17a5d7425c
847 changed files with 106095 additions and 0 deletions

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