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,3 @@
fileFormatVersion: 2
guid: 3b9504e434a44b2e8917bc39c318fb94
timeCreated: 1725859219

View File

@@ -0,0 +1,14 @@
using UnityEngine;
namespace Event.EventArgs
{
public class CameraInterActArgs : System.EventArgs
{
public GameObject Item { get; }
public CameraInterActArgs(GameObject item)
{
Item = item;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7d7b7ed755c3432eb1ffd466ce229575
timeCreated: 1725859232

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4cf9fa5509bd4199a7ee9c43efae6a6e
timeCreated: 1725859119

View File

@@ -0,0 +1,6 @@
using Event.EventArgs;
namespace Event.EventHandler
{
public delegate void CameraInterActHandler(CameraInterActArgs e);
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e4c03d33ea9c40bf8e045c468a7bc0d9
timeCreated: 1725859168

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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c6c7b780f301469883211fac6d1fe774
timeCreated: 1725858879