This commit is contained in:
2024-09-09 20:30:24 +08:00
commit f1e9f43ba4
165 changed files with 103426 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using Event.EventArgs;
using Event.EventHandler;
using UnityEngine;
namespace Event
{
public class EventManager : MonoBehaviour
{
private static EventManager _instance;
public static EventManager Instance
{
get
{
if (_instance)
return _instance;
_instance = FindObjectOfType<EventManager>() ??
new GameObject("EventManager").AddComponent<EventManager>();
return _instance;
}
}
private void Awake()
{
if (_instance != null && _instance != this)
{
Destroy(gameObject);
}
else
{
_instance = this;
}
}
public event CameraInterActHandler CameraInterAct;
public void OnCameraInterAct(GameObject item)
{
CameraInterAct?.Invoke(new CameraInterActArgs(item));
}
}
}