/// <summary> /// Activates the singleton instance. /// </summary> /// <remarks> /// Call this function if you set an singleton object inactive before ever accessing the <c>Instance</c>. This is /// required because Unity does not (yet) offer a way to find inactive game objects. /// </remarks> static public void ActivateSingletonInstance() // { UnitySingleton <T> .GetSingleton(true, true); }
/// <summary> /// Checks if an instance of this MonoBehaviour exists. /// </summary> public static bool DoesInstanceExist( ) { return(UnitySingleton <T> .GetSingleton(false, null) != null); }
/// <summary> /// Checks if an instance of this MonoBehaviour exists. /// </summary> /// <returns> /// A reference to the instance if it exists, otherwise <c>null</c> /// </returns> static public T DoesInstanceExist() { return(UnitySingleton <T> .GetSingleton(false, false)); }
public static Boolean DoesInstanceExist() { AudioController singleton = UnitySingleton <AudioController> .GetSingleton(false, false); return(!Object.Equals(singleton, null)); }