void OnDoubleClick() { if (doubleClick.IsNotEmpty()) { AudioBridge.Play(doubleClick); } }
void OnClick() { if (click.IsNotEmpty()) { AudioBridge.Play(click); } }
void OnSelect(bool selected) { if (selected && select.IsNotEmpty()) { AudioBridge.Play(select); } else if (!selected && deselect.IsNotEmpty()) { AudioBridge.Play(deselect); } }
void OnPress(bool pressed) { if (pressed && press.IsNotEmpty()) { AudioBridge.Play(press); } else if (!pressed && release.IsNotEmpty()) { AudioBridge.Play(release); } }
void OnHover(bool isOver) { if (isOver && hoverOver.IsNotEmpty()) { AudioBridge.Play(hoverOver); } else if (!isOver && hoverOut.IsNotEmpty()) { AudioBridge.Play(hoverOut); } }
private void InitializeAudioBridge() { try { m_audioBridge = new AudioBridge(StkAudioEngine) { AudioOutput = StkAudioEngine.AudioOutput }; AudioSettings.OnAudioConfigurationChanged += AudioSettings_OnAudioConfigurationChanged; AudioSettings_OnAudioConfigurationChanged(false); m_soundToolKitMixer = (AudioMixer)Resources.Load(MIXER_PATH); } catch (Exception e) { SoundToolKitDebug.LogError("Message: " + e.Message + "\nStack Trace: " + e.InnerException); } }
protected virtual void PlayAudio() { #if NGUI_AUDIO AudioBridge.Play(GetType().Name); #endif }