// Called when the user clicks on the button private void HandleClick() { // Depending on the button type, it will enable/disable one or other option switch (m_ButtonType) { case ButtonType.Music: { m_MenuOptions.SwipeMusic(m_AroundAlpha); break; } case ButtonType.Voices: { m_MenuOptions.SwipeVoices(m_AroundAlpha); break; } case ButtonType.SoundEffects: { m_MenuOptions.SwipeInteractionSounds(m_AroundAlpha); break; } case ButtonType.Messages: { m_MenuOptions.SwipeMessages(m_AroundAlpha); break; } case ButtonType.Subtitles: { m_MenuOptions.SwipeSubtitles(m_AroundAlpha); break; } default: { break; } } // If the interaction sounds option is enabled, plays the on click clip if (m_SoundEffectsEnabled) { m_GazeAudio.clip = m_OnClickClip; m_GazeAudio.Play(); } // The above conditional is after the switch to give the user a good sense // when he/she enables or disables the interaction sounds option: // - If the user enables the option, it will play the sound indicating it is enabled. // - If the user disables the option, it will not play the sound indicating it is disabled. }