Fix continuous triggering of buying shapes with controller
This commit is contained in:
parent
f73fa84ca6
commit
6c60821469
1 changed files with 11 additions and 4 deletions
|
|
@ -164,7 +164,7 @@
|
||||||
|
|
||||||
spawnClone();
|
spawnClone();
|
||||||
notify("Spawned " + _shapeId + " (" + (live + 1) + "/" + owned + " active)");
|
notify("Spawned " + _shapeId + " (" + (live + 1) + "/" + owned + " active)");
|
||||||
_busy = false;
|
// _busy stays true until trigger release (stopNearTrigger/stopFarTrigger/clickUpOnEntity)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -175,9 +175,16 @@
|
||||||
_entityID = entityID;
|
_entityID = entityID;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.clickDownOnEntity = function () {
|
// Mouse
|
||||||
onClickDown();
|
this.clickDownOnEntity = function () { onClickDown(); };
|
||||||
};
|
this.clickUpOnEntity = function () { _busy = false; };
|
||||||
|
|
||||||
|
// Controller — near (<0.3m) and far (>0.3m)
|
||||||
|
// Requires "Triggerable" checkbox enabled on the entity.
|
||||||
|
this.startNearTrigger = function () { onClickDown(); };
|
||||||
|
this.stopNearTrigger = function () { _busy = false; };
|
||||||
|
this.startFarTrigger = function () { onClickDown(); };
|
||||||
|
this.stopFarTrigger = function () { _busy = false; };
|
||||||
|
|
||||||
this.unload = function () {
|
this.unload = function () {
|
||||||
_token = null;
|
_token = null;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue