diff --git a/src/utils/PrimaryActionHandler.js b/src/utils/PrimaryActionHandler.js deleted file mode 100644 index b838d005de0359c5d1f486ed20b4e005c4cc49d0..0000000000000000000000000000000000000000 --- a/src/utils/PrimaryActionHandler.js +++ /dev/null @@ -1,51 +0,0 @@ -export default class PrimaryActionHandler { - constructor(scene) { - this.cursor = null; - this.handledByCursor = false; - this.handledByTeleport = false; - - this.rightTeleporter = null; - this.leftTeleporter = null; - this.scene = scene; - - this.registerCursor = this.registerCursor.bind(this); - this.isReady = this.isReady.bind(this); - this.addEventListeners = this.addEventListeners.bind(this); - this.onPrimaryDown = this.onPrimaryDown.bind(this); - this.onPrimaryUp = this.onPrimaryUp.bind(this); - } - - registerCursor(cursor) { - this.cursor = cursor; - if (this.isReady()) { - this.addEventListeners(); - } - } - - isReady() { - return this.cursor; // && this.rightTeleporter && this.leftTeleporter; - } - - addEventListeners() { - this.scene.addEventListener("action_primary_down", this.onPrimaryDown); - this.scene.addEventListener("action_primary_up", this.onPrimaryUp); - } - - onPrimaryDown(e) { - this.handledByCursor = this.cursor.beginInteraction(); - if (this.handledByCursor) return; - // Do teleport things. - console.log(e); - if (e.components["teleport-controls"]) { - console.log("yes"); - } - console.log("no"); - } - - onPrimaryUp(e) { - if (this.handledByCursor) { - this.cursor.endInteraction(); - return; - } - } -}