// ════════════════════════════════════════════════════════ METHODS ════ // initialize references /// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { if (_instance != null) { Destroy(gameObject); } else { _instance = this; _player = Object.FindObjectOfType <ThirdPersonCharacter> (); _objective = Object.FindObjectOfType <Objective> (); _goalEffect = Object.FindObjectOfType <GoalEffect> (); } }
// initialize references private void Awake() { _player = Object.FindObjectOfType <ThirdPersonCharacter>(); _objective = Object.FindObjectOfType <Objective>(); _goalEffect = Object.FindObjectOfType <GoalEffect>(); }