11 lines
272 B
JavaScript
11 lines
272 B
JavaScript
AFRAME.registerComponent('toggle-pause-play', {
|
|
schema: {
|
|
isPlaying: { default: false },
|
|
},
|
|
|
|
update: function() {
|
|
const action = this.data.isPlaying ? 'pause' : 'play';
|
|
parent.postMessage(JSON.stringify({ verify: 'game-action', action }), '*');
|
|
},
|
|
});
|