This commit is contained in:
James B. Pollack 2016-08-18 14:36:52 -07:00
parent 2e22bc5e46
commit 859d3ccadc

View file

@ -72,6 +72,8 @@ function Trigger(hand) {
};
}
var coolInTimeout = null;
function Teleporter() {
var _this = this;
this.intersection = null;
@ -85,6 +87,7 @@ function Teleporter() {
this.tooClose = false;
this.inCoolIn = false;
this.initialize = function() {
this.createMappings();
this.disableGrab();
@ -113,7 +116,11 @@ function Teleporter() {
inTeleportMode = true;
this.inCoolIn = true;
print('setting cool in timeout')
this.coolInTimeout = Script.setTimeout(function() {
if (coolInTimeout !== null) {
Script.clearTimeout(coolInTimeout);
}
coolInTimeout = Script.setTimeout(function() {
print('should exit cool in mode now' + COOL_IN_DURATION)
_this.inCoolIn = false;
}, COOL_IN_DURATION)
@ -208,9 +215,9 @@ function Teleporter() {
this.updateConnected = null;
this.inCoolIn = false;
inTeleportMode = false;
Script.setTimeout(function() {
inTeleportMode = false;
_this.enableGrab();
}, 200);
};