Play On Click

๐Ÿ‘‰Boop!

Like what your seeing?

Support us as a GitHub Sponsor and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our GitHub Sponsors ... become a sponsor today!

Introduction

Part of the Interaction Tools of the UX Complete asset

A simple component which plays an audio clip when a click is detected. This uses Unity's IPointerClickHandler to detect when a click occurs and what buttons were involved with it if any.

Definition

Fields and Attributes

TypeNameNotes

AudioSource

output

used to play the sound

AudioClip

sound

the sound to be played

float

volumeScale

the scale of the volume for this play

bool

alwaysPlay

Should the sound play on any click event regardless of buttons used

bool

handleLeftClick

play when left button used

bool

handleRightClick

play when right button used

bool

handleMiddleClick

play when middle button used

Last updated