mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:07:58 +02:00
cleanup beamdisabler
This commit is contained in:
parent
13e1042bfa
commit
52edc3b701
1 changed files with 4 additions and 8 deletions
|
@ -1214,6 +1214,7 @@ mapping.from([Controller.Standard.LB]).peek().to(leftController.bumperPress);
|
||||||
Controller.enableMapping(MAPPING_NAME);
|
Controller.enableMapping(MAPPING_NAME);
|
||||||
|
|
||||||
var handToDisable = 'none';
|
var handToDisable = 'none';
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
if (handToDisable !== 0) {
|
if (handToDisable !== 0) {
|
||||||
leftController.update();
|
leftController.update();
|
||||||
|
@ -1225,26 +1226,21 @@ function update() {
|
||||||
|
|
||||||
Messages.subscribe('Hifi-Beam-Disabler');
|
Messages.subscribe('Hifi-Beam-Disabler');
|
||||||
|
|
||||||
handleBeamDisablerMessages = function(channel, message,sender) {
|
handleBeamDisablerMessages = function(channel, message, sender) {
|
||||||
print("got message:"+message+" on channel:" + channel + " from sender:"+sender);
|
|
||||||
handToDisable = message;
|
handToDisable = message;
|
||||||
if(message==='left'){
|
if (message === 'left') {
|
||||||
handToDisable = 1;
|
handToDisable = 1;
|
||||||
}
|
}
|
||||||
if(message==='right'){
|
if (message === 'right') {
|
||||||
handToDisable = 0;
|
handToDisable = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Messages.messageReceived.connect(handleBeamDisablerMessages);
|
Messages.messageReceived.connect(handleBeamDisablerMessages);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
rightController.cleanup();
|
rightController.cleanup();
|
||||||
leftController.cleanup();
|
leftController.cleanup();
|
||||||
Entities.deleteEntity(beamDisabler);
|
|
||||||
Controller.disableMapping(MAPPING_NAME);
|
Controller.disableMapping(MAPPING_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue