Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Checks if an instance of this MonoBehaviour exists.
 /// </summary>
 public static bool DoesInstanceExist( )
 {
     return(UnitySingleton <T> .GetSingleton(false, null) != null);
 }
Ejemplo n.º 3
0
 /// <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));
 }
Ejemplo n.º 4
0
    public static Boolean DoesInstanceExist()
    {
        AudioController singleton = UnitySingleton <AudioController> .GetSingleton(false, false);

        return(!Object.Equals(singleton, null));
    }