Skip to content

Instantly share code, notes, and snippets.

@andijakl
Created August 8, 2019 11:18
Show Gist options
  • Save andijakl/ae0c3e2ff1e971760080d6a98cf8bd4f to your computer and use it in GitHub Desktop.
Save andijakl/ae0c3e2ff1e971760080d6a98cf8bd4f to your computer and use it in GitHub Desktop.
Remove the event listener for the touch event in Amazon Sumerian.
// Cleanup. When this script stops, also remove the event listeners.
// This is especially important here, as Sumerian doesn't always reliably
// clean up all the runtime-registrations when you repeatedly start the scene.
ctx.onStop(
() => {
console.log("Removing touch event listener.");
this.internalWorld.sumerianRunner.renderer.domElement.removeEventListener('touchend', performHitTestCallback);
// For testing on the PC with a mouse
//this.internalWorld.sumerianRunner.renderer.domElement.removeEventListener('mouseup', performHitTestCallback);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment