private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } if (soundManager == null) { soundManager = GameObject.Find("SoundManager").GetComponent <SoundManager>(); } }
private void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } // Cache references to all desired variables if (patrollZones == null) { patrollZones = GameObject.Find("PatrollPoints"); } if (menuCanvas == null) { menuCanvas = GameObject.Find("MenuCanvas"); } if (NavMesh == null) { NavMesh = GameObject.Find("NavMesh"); } if (player == null) { player = GameObject.Find("Player"); } if (playerNoise == null) { playerNoise = GameObject.Find("PlayerNoise").GetComponent <PlayerNoise>(); } if (soungManager == null) { soungManager = GameObject.Find("SoundManager").GetComponent <SoundManager>(); } if (objectivesData == null) { Debug.LogError("ObjRemaining Obj not Ini in the ObjectRef Class"); } InitObjectiveList(); }