This commit is contained in:
@@ -85,6 +85,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch:{
|
||||||
|
async 'object.scenario'(n){
|
||||||
|
await this.loadScenario()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods:{
|
methods:{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
scenario(n){
|
scenario(n){
|
||||||
|
this.debug('Scenario changed', n);
|
||||||
if (n){
|
if (n){
|
||||||
this.scenesList = [this.scenes?.[0]];
|
this.scenesList = [this.scenes?.[0]];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,9 +73,6 @@ export default {
|
|||||||
mode(n){
|
mode(n){
|
||||||
engine.transformControls.setMode(n)
|
engine.transformControls.setMode(n)
|
||||||
},
|
},
|
||||||
async 'object.scenario'(n){
|
|
||||||
await this.loadScenario()
|
|
||||||
},
|
|
||||||
currentObject(n){
|
currentObject(n){
|
||||||
if (this.env == 'GameDesigner'){
|
if (this.env == 'GameDesigner'){
|
||||||
engine.transformControls.attach(n.__o);
|
engine.transformControls.attach(n.__o);
|
||||||
@@ -124,6 +121,7 @@ export default {
|
|||||||
* @param target Target scene definition from Game Module
|
* @param target Target scene definition from Game Module
|
||||||
*/
|
*/
|
||||||
async loadEnvironment(scene, target){
|
async loadEnvironment(scene, target){
|
||||||
|
this.debug('loading environment');
|
||||||
engine.tm?.setGame(this.object?.id);
|
engine.tm?.setGame(this.object?.id);
|
||||||
//await engine.loadPanorama(`/asset/default/43.webp`);
|
//await engine.loadPanorama(`/asset/default/43.webp`);
|
||||||
let intro;
|
let intro;
|
||||||
@@ -160,7 +158,7 @@ export default {
|
|||||||
if (this.env != 'GameDesigner'){
|
if (this.env != 'GameDesigner'){
|
||||||
env.scene.traverse(o=>{
|
env.scene.traverse(o=>{
|
||||||
if (o.name.startsWith('land') || o.name == 'Sphere'){
|
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})
|
engine.physics.add(o, 'fixed', true, undefined, 'mesh', { root: env.scene})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -217,7 +215,7 @@ export default {
|
|||||||
});
|
});
|
||||||
if (finished == expectToFinish){
|
if (finished == expectToFinish){
|
||||||
//GO TO NEXT LEVEL
|
//GO TO NEXT LEVEL
|
||||||
console.log('LEVEL FINISHED')
|
this.debug('LEVEL FINISHED')
|
||||||
}
|
}
|
||||||
engine.tm?.setGameObject(null);
|
engine.tm?.setGameObject(null);
|
||||||
});
|
});
|
||||||
@@ -301,7 +299,7 @@ export default {
|
|||||||
},
|
},
|
||||||
resize(){
|
resize(){
|
||||||
let r = this.$refs.target;
|
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);
|
engine.resize(r.clientWidth, r.clientHeight);
|
||||||
//this.zoom = Math.min(r.clientWidth / this.viewBox.w, r.clientHeight / this.viewBox.h);
|
//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.color = color;
|
||||||
this.store.snackbar.timeout = timeout;
|
this.store.snackbar.timeout = timeout;
|
||||||
this.store.snackbar.show = true;
|
this.store.snackbar.show = true;
|
||||||
|
},
|
||||||
|
debug(...args){
|
||||||
|
if (this.store?.prefs?.debug){
|
||||||
|
console.log(...args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container max-width="1400">
|
<v-container max-width="1400">
|
||||||
<GamePreview v-model="object"></GamePreview>
|
<GamePreview v-model="object" v-if="object"></GamePreview>
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
object: {},
|
object: null,
|
||||||
valid: false,
|
valid: false,
|
||||||
rules: {
|
rules: {
|
||||||
required: v => v ? true : this.l.fieldRequired,
|
required: v => v ? true : this.l.fieldRequired,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container max-width="1400">
|
<v-container max-width="1400">
|
||||||
<GamePlay v-model="object"></GamePlay>
|
<GamePlay v-model="object" v-if="object"></GamePlay>
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
object: {},
|
object: null,
|
||||||
valid: false,
|
valid: false,
|
||||||
rules: {
|
rules: {
|
||||||
required: v => v ? true : this.l.fieldRequired,
|
required: v => v ? true : this.l.fieldRequired,
|
||||||
|
|||||||
Reference in New Issue
Block a user