/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { // save global instance Instance = this; // search gameobject and component with tag at once player = GameObject.FindGameObjectWithTag("Player"); playerController = player.GetComponent <PlayerController> (); uiRoot = GameObject.FindGameObjectWithTag("UI"); uiController = uiRoot.GetComponent <UIRootController> (); enemyManager = GetComponentInChildren <EnemyManager> (); }
void Awake() { instance = this; }