示例#1
0
    /*
     * Fill the switch case like this, so that we can preload the audio clips
     */

    public string switchUISoundEffects(UISoundeffects incomingEnum)
    {
        string convertedString = "";

        switch (incomingEnum)
        {
        case UISoundeffects.Confirm:
            convertedString = "Audio/UIMain/" + "Confirm";
            return(convertedString);;

        case UISoundeffects.Decline:
            convertedString = "Audio/UIMain/" + "Decline";
            return(convertedString);

        case UISoundeffects.NextElement:
            convertedString = "Audio/UIMain/" + "NextElement";
            return(convertedString);
        }
        return(convertedString);
    }
示例#2
0
 /*
  * Use the AudioEnum of the corrsponding function to play the sound file
  */
 public void setUISoundEffects(UISoundeffects incomingEnum)
 {
     allMainAudioSources[(int)allMainAudioSourcesEnum.UI].clip = uiSoundClips[(int)incomingEnum];
     allMainAudioSources[(int)allMainAudioSourcesEnum.UI].Play();
 }