public void Start() { commandDictionary = new Dictionary <string, string>(); for (int i = 0; i < morseCodeCommands.Length; i++) { commandDictionary.Add(morseCodeCommands[i], commandFunctions[i]); } submarineMovement = GameObject.FindGameObjectWithTag("Submarine").GetComponent <SubmarineMovement>(); }
private void Awake() { // Ensure that there is only one instance of the PlayerManager. if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } movement = GetComponent <SubmarineMovement>(); camFX = GetComponentInChildren <CameraFX>(); playerLightManager = GetComponentInChildren <PlayerLightManager>(); playerSoundManager = GetComponentInChildren <PlayerSoundManager>(); dashboardDamageSprite = GetComponentInChildren <SpriteRenderer>(); }