/// <summary> /// Plays a game play sound effect /// </summary> /// <param name="name">the name of the sound effect</param> public void PlayGamePlaySoundEffect(GamePlaySoundEffect name) { if (gamePlaySoundEffectsDict.ContainsKey(name)) { gamePlaySoundEffectsAudioSource.PlayOneShot(gamePlaySoundEffectsDict[name]); } }
/// <summary> /// Gets a sound effect from the sound effect dictionary /// </summary> /// <param name="name">the name of the sound effect</param> /// <returns></returns> public AudioClip GetSoundEffect(GamePlaySoundEffect name) { if (gamePlaySoundEffectsDict.ContainsKey(name)) { return(gamePlaySoundEffectsDict[name]); } else { Debug.Log("Key " + name + " is not in the sound effect dictionary!"); return(null); } }