Verse Library verse

01 Fragment

Subscribes a handler function to a button interaction event to trigger jukebox audio toggle logic.

verse-library/verse-sound-jukebox-capstone/01-fragment.verse

# The Button Device's InteractedWithEvent fires when a player holds-to-use it.
# Subscribe a handler and you have a one-line "press the jukebox" hook. We keep
# a var playing flag so each press TOGGLES the music: on, off, on, off.
JukeboxButton.InteractedWithEvent.Subscribe(OnButtonPressed)

Comments

    Sign in to vote, comment, or suggest an edit. Sign in