UIButtonSfx#
- NAMESPACE:
UnityUtils.ScriptUtils.UI
Usage#
Add a ‘UIButtonSfx’ Script to a UI button and add a hover enter, hover exit, and click sound effect. You don’t need to add all of these sound effects, but if you don’t add all of them you can enable ‘emptySfxErrorMessages’. You can also edit the volume for each type of sound effect and set the volume type.
Functions#
- UnityUtils.ScriptUtils.UI.UIButtonSFX : MonoBehaviour , IPointerEnterHandler , IPointerExitHandler , IPointerClickHandler
Public Members
-
AudioClip hoverEnterSfx#
Sound to play when the mouse cursor enters the buttons hitbox.
-
float hoverEnterVolume = AudioManager.MAX_AUDIO_VOLUME#
Volume to play hoverEnterSfx at.
-
AudioClip hoverExitSfx#
Sound to play when the mouse cursor exits the buttons hitbox.
-
float hoverExitVolume = AudioManager.MAX_AUDIO_VOLUME#
Volume to play hoverExitSfx at.
-
AudioClip clickSfx#
Sound to play when the mouse clicks on the button.
-
float pitchVariance = AudioManager.DEFAULT_PITCH_VARIANCE#
Random variance to play all audio clips at.
- AudioManager.VolumeType volumeType = AudioManager.VolumeType.Sfx
Type of audio to use to get proper audio levels.
-
bool logEmptySfx#
If true this will log errors when trying to play sound effects but they become empty.
-
AudioClip hoverEnterSfx#