public static int UISoundTypeToIndex(this UISoundType UIsoundType) { switch (UIsoundType) { default: return(0); case UISoundType.ButtonNext: return(1); case UISoundType.ButtonBack: return(2); case UISoundType.ButtonError: return(3); case UISoundType.Access: return(4); case UISoundType.Success: return(5); case UISoundType.Switch: return(6); case UISoundType.SoundCheck: return(7); case UISoundType.Click: return(8); case UISoundType.Interrupt: return(9); } }
public static void PlayUISound(UISoundType type) { AudioClip audioClip = null; switch (type) { case UISoundType.StartGame: audioClip = Main.StartSE; break; case UISoundType.Select: audioClip = Main.SelectSE; break; case UISoundType.Press: audioClip = Main.PressSE; break; case UISoundType.Cancel: audioClip = Main.CancelSE; break; } if (IsAudioClipNull(audioClip)) { return; } Main.UI_SE_Source.clip = audioClip; Main.UI_SE_Source.Play(); }
private String GetTypeSound(UISoundType type) { switch (type) { case UISoundType.UIAdd: return("snd_ui_add"); case UISoundType.UIBuy: return("snd_ui_buy"); case UISoundType.UIHit: return("snd_ui_hit"); case UISoundType.UIError: return("snd_ui_error"); case UISoundType.UIOpenBag: return("snd_ui_openbag"); case UISoundType.UIOpen: return("snd_ui_open"); case UISoundType.UIColse: return("snd_ui_close"); case UISoundType.UIYes: return("snd_ui_yes"); case UISoundType.UINo: return("snd_ui_no"); } return(""); }
public override void OnInspectorGUI() { if (_player == null) { _player = target as UISoundFXPlayer; } UISoundType type = (UISoundType)EditorGUILayout.EnumPopup("Clipping", _player.SoundType); if (_player.SoundType != type) { _player.SoundType = type; } String name = EditorGUILayout.TextField("SoundName", _player.SoundName); if (_player.SoundName != name) { _player.SoundName = name; } }
void PlayInternal(UISoundType type) { _ui.pitch = Random.Range(.75f, 1.25f); _ui.clip = _clips[(int)type].Random(); _ui.Play(); }
public static void Play(UISoundType type) { instance.PlayInternal(type); }
public UISoundForSO(UISoundType _soundEffectType) { uISoundType = _soundEffectType; }