public SoundService(SoundScriptableObject _soundObject, List <SoundController> listOfAudioSources) { currentAudioSources = listOfAudioSources; currentSoundObj = _soundObject; backgroundMusic = currentSoundObj.backgroundMusic; shootingSound = currentSoundObj.shootingSound; playerDeath = currentSoundObj.playerDeathSound; gameOver = currentSoundObj.gameOverSound; RegisterFunctions(); PlayBackgroundSound(); }
private void Update() { if (Input.GetKeyDown(KeyCode.Backspace)) { keyCall = !keyCall; } for (int i = 0; i < soundSwitchKeys.Length; i++) { if (Input.GetKeyDown(soundSwitchKeys[i])) { soundSet = soundSetList[i]; } } }