add dynamic spawning

This commit is contained in:
WillJeynes
2026-08-24 13:53:58 +01:00
parent ae2e8daa6f
commit 641564b461
36 changed files with 1774 additions and 18 deletions
+21
View File
@@ -0,0 +1,21 @@
using UnityEngine;
namespace Utils
{
public abstract class Singleton<T> : MonoBehaviour where T : MonoBehaviour
{
public static T Instance { get; private set; }
protected virtual void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(gameObject);
return;
}
Instance = this as T;
DontDestroyOnLoad(gameObject);
}
}
}