From f25a9dcede2c455f8b4a65ecdf9c8b54bc1cb919 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 26 May 2017 13:01:19 +1200 Subject: [PATCH] Add entities to capture stopwatch button clicks --- .../marketplace/stopwatch/spawnStopwatch.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/unpublishedScripts/marketplace/stopwatch/spawnStopwatch.js b/unpublishedScripts/marketplace/stopwatch/spawnStopwatch.js index e72f949163..c4496865d9 100644 --- a/unpublishedScripts/marketplace/stopwatch/spawnStopwatch.js +++ b/unpublishedScripts/marketplace/stopwatch/spawnStopwatch.js @@ -43,6 +43,26 @@ var minuteHandID = Entities.addEntity({ modelURL: Script.resolvePath("models/Stopwatch-min-hand.fbx"), }); +var startStopButtonID = Entities.addEntity({ + type: "Shape", + shape: "Octagon", + name: "stopwatch/startStop", + parentID: stopwatchID, + dimensions: Vec3.multiply(scale, { x: 0.8, y: 1.0, z: 0.8 }), + localPosition: Vec3.multiply(scale, { x: 0, y: -0.1, z: -2.06 }), + localRotation: Quat.fromVec3Degrees({ x: 90, y: 0, z: 0 }), +}); + +var resetButtonID = Entities.addEntity({ + type: "Shape", + shape: "Octagon", + name: "stopwatch/startStop", + parentID: stopwatchID, + dimensions: Vec3.multiply(scale, { x: 0.6, y: 0.8, z: 0.6 }), + localPosition: Vec3.multiply(scale, { x: -1.5, y: -0.1, z: -1.2 }), + localRotation: Quat.fromVec3Degrees({ x: 90, y: 36, z: 0 }), +}); + Entities.editEntity(stopwatchID, { userData: JSON.stringify({ secondHandID: secondHandID,