Bind TapEvent to a specific input

audun
Posts: 242 🔥🔥🔥
I'm trying to modify a script that is currently attached to my Orthographic camera.
The script runs whenever a tap is registered on the screen, but I want to modify it so that it only runs when someone taps one of the image inputs (muted or playing).
Here's the current script:
//@input Component.AudioComponent audio //@input Component.Image muted //@input Component.Image playing var isPlaying = true; script.muted.enabled = false; function onToggle() { print("paused: " + script.audio.isPaused()) isPlaying = !isPlaying; if (isPlaying) { print("playinhg" + isPlaying) script.audio.resume() script.playing.enabled = true; script.muted.enabled = false; } else { print("pausing") script.audio.pause(); script.playing.enabled = false; script.muted.enabled = true; } } script.createEvent("TapEvent").bind(onToggle);
How can I do this?
Tagged:
0
Best Answer
Categories
- 0 All Categories
- Snap AR | Categories
- 2K Lens Studio
- 150 Camera Kit
- 16 Spectacles