using System.Collections; using System.Collections.Generic; using UnityEngine; public class Singleton where T : new() { static T instance; public static T Instance { get { if (instance == null) return instance = new T(); return instance; } } }