コード例 #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);
 }
コード例 #2
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));
 }