public static void DestroyInstance(Type type) { ISingleton singleton = null; if (_singletons.TryGetValue(type, out singleton)) { singleton.Dispose(); _singletons.Remove(type); if (type.IsSameOrSubClass(typeof(SingletonMono))) { UnityEngine.Object.Destroy((singleton as SingletonMono).gameObject); } DebugEx.Log(ELogType.System, $"Singleton: Destroy instance, type= {type.Name}."); } }
public void Dispose() { _singleton.Dispose(); }