This commit is contained in:
@@ -73,9 +73,6 @@ export default {
|
||||
mode(n){
|
||||
engine.transformControls.setMode(n)
|
||||
},
|
||||
async 'object.scenario'(n){
|
||||
await this.loadScenario()
|
||||
},
|
||||
currentObject(n){
|
||||
if (this.env == 'GameDesigner'){
|
||||
engine.transformControls.attach(n.__o);
|
||||
@@ -124,6 +121,7 @@ export default {
|
||||
* @param target Target scene definition from Game Module
|
||||
*/
|
||||
async loadEnvironment(scene, target){
|
||||
this.debug('loading environment');
|
||||
engine.tm?.setGame(this.object?.id);
|
||||
//await engine.loadPanorama(`/asset/default/43.webp`);
|
||||
let intro;
|
||||
@@ -160,7 +158,7 @@ export default {
|
||||
if (this.env != 'GameDesigner'){
|
||||
env.scene.traverse(o=>{
|
||||
if (o.name.startsWith('land') || o.name == 'Sphere'){
|
||||
console.log('Fixing ground. TODO!!!')
|
||||
this.debug('Fixing ground. TODO!!!')
|
||||
engine.physics.add(o, 'fixed', true, undefined, 'mesh', { root: env.scene})
|
||||
}
|
||||
})
|
||||
@@ -217,7 +215,7 @@ export default {
|
||||
});
|
||||
if (finished == expectToFinish){
|
||||
//GO TO NEXT LEVEL
|
||||
console.log('LEVEL FINISHED')
|
||||
this.debug('LEVEL FINISHED')
|
||||
}
|
||||
engine.tm?.setGameObject(null);
|
||||
});
|
||||
@@ -301,7 +299,7 @@ export default {
|
||||
},
|
||||
resize(){
|
||||
let r = this.$refs.target;
|
||||
console.log('resizing!!', r.clientWidth, r.clientHeight, r)
|
||||
this.debug('resizing!!', r.clientWidth, r.clientHeight, r)
|
||||
engine.resize(r.clientWidth, r.clientHeight);
|
||||
//this.zoom = Math.min(r.clientWidth / this.viewBox.w, r.clientHeight / this.viewBox.h);
|
||||
},
|
||||
|
||||
@@ -51,6 +51,11 @@ export default {
|
||||
this.store.snackbar.color = color;
|
||||
this.store.snackbar.timeout = timeout;
|
||||
this.store.snackbar.show = true;
|
||||
},
|
||||
debug(...args){
|
||||
if (this.store?.prefs?.debug){
|
||||
console.log(...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user