Advertisement
Guest User

Lens Script

a guest
Apr 24th, 2018
199
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.17 KB | None
  1. // -----JS CODE-----
  2. //@input SceneObject face1
  3. //@input SceneObject face2
  4. //@input SceneObject face3
  5. var tap_count = 0;
  6.  
  7. function tap_check() {
  8.   if (tap_count === 0) {
  9.   script.face1.enabled = true;
  10.   script.face2.enabled = false;
  11.   script.face3.enabled = false;
  12.   global.logToScreen(tap_count.toString());
  13.   global.logToScreen("lucia_mask");
  14.   }
  15.   else if (tap_count === 1) {
  16.   script.face1.enabled = false;
  17.   script.face2.enabled = true;
  18.   script.face3.enabled = false;
  19.   global.logToScreen(tap_count.toString());
  20.   global.logToScreen("mac_mask");
  21.   }
  22.   else if (tap_count === 2) {
  23.   script.face1.enabled = false;
  24.   script.face2.enabled = false;
  25.   script.face3.enabled = true;
  26.   global.logToScreen(tap_count.toString());
  27.   global.logToScreen("dylan_mask");
  28.   }
  29.   else {
  30.   tap_count = 0;
  31.   }
  32.  
  33. }
  34.  
  35. function onTapped(eventData)
  36. {
  37.     //global.logToScreen("Tap Position: (" + eventData.getTapPosition().x + ", " + eventData.getTapPosition().y + ")");
  38.     tap_count = tap_count + 1;
  39.  
  40.     global.logToScreen("tap")
  41.     global.logToScreen(tap_count.toString());
  42.     tap_check();
  43.  
  44.  
  45. }
  46.  
  47.  
  48. var event = script.createEvent("TapEvent");
  49. event.bind(onTapped);
Advertisement
RAW Paste Data Copied
Advertisement