16 using System.Collections;
17 using 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) )
84 if(
s_Instance.gameObject.transform.parent ==
null && Application.isPlaying)
96 && Application.isPlaying)
98 string name =
string.Format(
"__{0}__", typeof( T ).FullName );
99 GameObject singletonGo =
new GameObject( name );
101 if(
s_Instance.gameObject.transform.parent ==
null){
110 internal static bool IsInstantiated =>
s_Instance !=
null;
static readonly T instance