UIButtonSfx

Contents

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

SFX hoverEnterSFX = SFX.Create2dSFX()#

Sound to play when the button is hovered over.

SFX hoverExitSFX = SFX.Create2dSFX()#

Sound to play when the button is no longer being hovered.

SFX clickSFX = SFX.Create2dSFX()#

Sound to play when the button is clicked.

UIButtonDebugSettings debugLogs

Will output a Debug.Log(object) depending on the UIButtonDebugSettings.

bool logEmptySFX#

Will output a Debug.LogWarning(object) when a hover enter, exit, or click SFX tries to be played but no SFX clip is found.