diff --git a/src/components/sticky-object.js b/src/components/sticky-object.js index 9e9d8bff32b729edc341d8d7fb424abbfc7e166f..084004b8831c2626e0a8fd278c11767dc5008c62 100644 --- a/src/components/sticky-object.js +++ b/src/components/sticky-object.js @@ -12,11 +12,20 @@ AFRAME.registerComponent("sticky-object", { this._onGrab = this._onGrab.bind(this); this._onRelease = this._onRelease.bind(this); this._onBodyLoaded = this._onBodyLoaded.bind(this); + }, + + play() { this.el.addEventListener("grab-start", this._onGrab); this.el.addEventListener("grab-end", this._onRelease); this.el.addEventListener("body-loaded", this._onBodyLoaded); }, + pause() { + this.el.removeEventListener("grab-start", this._onGrab); + this.el.removeEventListener("grab-end", this._onRelease); + this.el.removeEventListener("body-loaded", this._onBodyLoaded); + }, + setLocked(locked) { if (!NAF.utils.isMine(this.el)) return;