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