This commit is contained in:
James Pollack 2015-09-23 17:43:08 -07:00
parent 6b468ee87b
commit 82f178a353

View file

@ -38,24 +38,14 @@
rightHand: false, rightHand: false,
handIsSet: false, handIsSet: false,
setLeftHand: function () { setLeftHand: function () {
if (this.handIsSet === false) {
this.leftHand = true;
this.rightHand = false;
this.setHand = 'left';
this.handIsSet = true;
} else {
this.currentHand = 'left' this.currentHand = 'left'
}
}, },
setRightHand: function () { setRightHand: function () {
if (this.handIsSet === false) {
this.rightHand = true;
this.leftHand = false;
this.setHand = 'right';
this.handIsSet = true;
} else {
this.currentHand = 'right' this.currentHand = 'right'
}
}, },
startNearGrab: function () { startNearGrab: function () {
if (this.isGrabbed === false) { if (this.isGrabbed === false) {
@ -70,18 +60,17 @@
volume: 0.1 volume: 0.1
}); });
this.isGrabbed = true; this.isGrabbed = true;
this.initialHand = this.hand;
print('INITIAL HAND:::' +this.initialHand)
} }
}, },
continueNearGrab: function () { continueNearGrab: function () {
if (this.setHand === this.currentHand) {
print('CONTINUING GRAB IN HAND') print('CONTINUING GRAB IN HAND')
var position = Entities.getEntityProperties(this.entityID, "position").position; var position = Entities.getEntityProperties(this.entityID, "position").position;
this.audioInjector.options.position = position; this.audioInjector.options.position = position;
}else{
print('NOT SAME HAND GRABBING')
}
}, },
releaseGrab: function () { releaseGrab: function () {
@ -92,12 +81,7 @@
}); });
this.isGrabbed = false; this.isGrabbed = false;
} }
if(this.setHand===this.currentHand){
print('SAME HAND LET GO')
}
else{
print('DIFFERENT HAND KEEP HOLDING')
}
}, },