Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- 'use strict';
- var scene = document.querySelector('a-scene'),
- tapTimer = null,
- tapSpeed = 500;
- document.addEventListener('touchstart', onCardboardTouch, false);
- function onCardboardTouch() {
- if (!tapTimer) {
- tapTimer = setTimeout(function() {
- tapTimer = null;
- }, tapSpeed);
- }
- else {
- clearTimeout(tapTimer);
- tapTimer = null;
- scene.enterVR();
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement