public static T CreateInstance() { if (_instance == null) { _instance = new T(); _instance.Initialize(); SingletonManager.Add(_instance); } return(_instance); }
public static T GetInstance() { if (_instance == null) { _instance = new T(); if (!SingletonManager.Add(_instance)) { _instance = null; return(null); } } return(_instance); }
public static T GetInstance() { if (_instance == null) { _instance = SingletonManager.MonoSingletonGo.ExtAddComponent <T>(); if (!SingletonManager.Add(_instance)) { _instance.ExtDestroy(); _instance = null; } } return(_instance); }
public void Add(int batchIndex, SingletonBase singleton) { _singletons.Add(batchIndex, singleton); }