16using System.Collections;
17using System.Collections.Generic;
57 T[] instances = Resources.FindObjectsOfTypeAll<T>();
58 if( instances !=
null )
62 for(
int i = 0; i < instances.Length; ++i )
64 T instance = instances[ i ];
65 if( instance ==
null )
70 if( instance.hideFlags != HideFlags.None )
76 if(
string.IsNullOrEmpty(instance.gameObject.scene.name) )
90 string name =
string.Format(
"__{0}__", typeof( T ).FullName );
91 GameObject singletonGo =
new GameObject( name );
100 internal static bool IsInstantiated =>
s_Instance !=
null;
static readonly T instance