void MakeSingleton() { Debug.Log("MakeSingleton is called from Main"); if (CrestIns != null) { Debug.Log("Game was not null and destroyed the object MakeSingleton in Main"); Destroy(gameObject); } else { Debug.Log("Not Destroy on load Active Make Singleton in Main"); CrestIns = this; DontDestroyOnLoad(gameObject); } }
void Awake() { MakeSingleton(); manager = GameObject.FindGameObjectWithTag("GameController").GetComponent <Main>(); crest = GameObject.FindGameObjectWithTag("GameController").GetComponent <CrestTest>(); }