This commit is contained in:
@@ -8,7 +8,7 @@ let engine = null;
|
||||
export default {
|
||||
|
||||
async mounted(){
|
||||
this.engine = engine = new GameEngine();
|
||||
engine = new GameEngine();
|
||||
await engine.init(this.$refs.target, {
|
||||
xr: true,
|
||||
gizmo: this.env == 'GameDesigner',
|
||||
@@ -32,7 +32,8 @@ export default {
|
||||
window.removeEventListener('resize', this.resize);
|
||||
engine.tm?.setGame(null);
|
||||
engine.dispose();
|
||||
this.debug('Disposed scene', engine.renderer.info.memory)
|
||||
this.debug('Disposed scene', engine.renderer.info.memory);
|
||||
engine = null;
|
||||
},
|
||||
|
||||
computed:{
|
||||
@@ -307,6 +308,13 @@ export default {
|
||||
|
||||
async fullScreen(){
|
||||
await engine.renderer.domElement.requestFullscreen()
|
||||
},
|
||||
|
||||
async setGameHeader(){
|
||||
let screenshot = await engine.captureScreenshot();
|
||||
let fd = new FormData();
|
||||
fd.append('file', screenshot);
|
||||
await this.$api.game.setHeader(this.modelValue.id, fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user