NBC修改

This commit is contained in:
bob
2025-07-03 14:16:18 +08:00
parent 4febfadd56
commit 800e96aac7
2083 changed files with 60081 additions and 2942 deletions

View File

@@ -1,48 +0,0 @@
using System;
using UnityEngine;
namespace NBC.Asset
{
public class Mono : MonoBehaviour
{
public static void AddUpdate(Action action)
{
Inst.OnUpdate += action;
}
public static void RemoveUpdate(Action action)
{
Inst.OnUpdate -= action;
}
private event Action OnUpdate;
private static bool IsQuiting { get; set; }
private static Mono _inst;
private static Mono Inst => _inst;
protected void OnApplicationQuit()
{
IsQuiting = true;
}
protected void Awake()
{
if (_inst != null)
{
DestroyImmediate(this.gameObject);
return;
}
DontDestroyOnLoad(gameObject);
_inst = this;
}
protected void Update()
{
OnUpdate?.Invoke();
}
}
}