コード例 #1
0
 /// <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]);
     }
 }
コード例 #2
0
 /// <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);
     }
 }