diff --git a/scripts/shelfShape.js b/scripts/shelfShape.js index 03e598a..ed2b1fa 100644 --- a/scripts/shelfShape.js +++ b/scripts/shelfShape.js @@ -164,7 +164,7 @@ spawnClone(); notify("Spawned " + _shapeId + " (" + (live + 1) + "/" + owned + " active)"); - _busy = false; + // _busy stays true until trigger release (stopNearTrigger/stopFarTrigger/clickUpOnEntity) }); }); } @@ -175,9 +175,16 @@ _entityID = entityID; }; - this.clickDownOnEntity = function () { - onClickDown(); - }; + // Mouse + 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 () { _token = null;