Only For camera
// -----CRX CODE-----
// @input SceneObject[] obj
var count = 0;
// Display the first object
script.obj[0].enabled = true;
// Disable all other objects
for (var i = 1; i < script.obj.length; i++) {
script.obj[i].enabled = false;
}
// Function called when the screen is tapped
function onTapped(eventData) {
count++;
// Loop through all objects
for (var i = 0; i < script.obj.length; i++) {
// If it's the current object, display it
if (count == i) {
script.obj[i].enabled = true;
} else {
// Otherwise, hide it
script.obj[i].enabled = false;
}
}
// If all objects have been displayed, restart from the beginning
if (count == script.obj.length) {
count = 0;
script.obj[0].enabled = true;
}
}
// Bind the function to the TapEvent
var event = script.createEvent("TapEvent");
event.bind(onTapped);