/// /// this class is not a MonoBehaviour. Its purpose is to make it possible to have global classes that will not be in the scene. /// /// public class Singleton where T : Singleton, new() { private static T _instance; public static T Instance { get { if (_instance == null) _instance = new T(); return _instance; } } }