void Awake() { if (instance == null) { instance = this; gameObject.SetActive(false); if (dontDestroyOnLoad) { DontDestroyOnLoad(instance.gameObject); } texture = CreateTexture(new Color(1f, 1f, 1f, 1f)); } else { Destroy(gameObject); } }
void Awake() { if( instance == null ){ instance= this; gameObject.SetActive( false ); if( dontDestroyOnLoad ){ DontDestroyOnLoad( instance.gameObject ); } texture = CreateTexture( new Color( 1f,1f,1f,1f ) ); } else{ Destroy( gameObject ); } }