From 52edc3b7017486751fd2021f0be5ccaddadc01af Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 24 Nov 2015 10:43:33 -0800 Subject: [PATCH] cleanup beamdisabler --- examples/controllers/handControllerGrab.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index 05e834577f..af42d8c2eb 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -1214,6 +1214,7 @@ mapping.from([Controller.Standard.LB]).peek().to(leftController.bumperPress); Controller.enableMapping(MAPPING_NAME); var handToDisable = 'none'; + function update() { if (handToDisable !== 0) { leftController.update(); @@ -1225,26 +1226,21 @@ function update() { Messages.subscribe('Hifi-Beam-Disabler'); -handleBeamDisablerMessages = function(channel, message,sender) { - print("got message:"+message+" on channel:" + channel + " from sender:"+sender); +handleBeamDisablerMessages = function(channel, message, sender) { handToDisable = message; - if(message==='left'){ + if (message === 'left') { handToDisable = 1; } - if(message==='right'){ + if (message === 'right') { handToDisable = 0; } - } Messages.messageReceived.connect(handleBeamDisablerMessages); - - function cleanup() { rightController.cleanup(); leftController.cleanup(); - Entities.deleteEntity(beamDisabler); Controller.disableMapping(MAPPING_NAME); }