scene switcher feature
This commit is contained in:
@@ -106,7 +106,9 @@ export default {
|
||||
})
|
||||
|
||||
for (let i of scene.data.items || []) {
|
||||
promises.push(this.$api.gameObject.load(i.data.go).then(r=>i.data.$go = r.data));
|
||||
Object.keys(i.data).filter(k=>k == 'go' || k.startsWith('go_')).forEach(k=>{
|
||||
promises.push(this.$api.gameObject.load(i.data[k]).then(r=>i.data['$'+k] = r.data));
|
||||
})
|
||||
}
|
||||
await Promise.all(promises);
|
||||
},
|
||||
@@ -193,15 +195,19 @@ export default {
|
||||
let idx = di.data.activationTriggers.indexOf(i.data.id)
|
||||
di.data.activationTriggers.splice(idx, 1);
|
||||
}
|
||||
if (!di.data.activationTriggers?.length && di.__io.object.__locked &&
|
||||
if (!di.data.activationTriggers?.length && di.__io.object.__active === false &&
|
||||
gameEngine.dashboard.points > di.data.activationScore){
|
||||
di.__io.locker.unlock();
|
||||
di.__io.activator.activate();
|
||||
}
|
||||
});
|
||||
if (finished == expectToFinish){
|
||||
//GO TO NEXT LEVEL
|
||||
console.log('LEVEL FINISHED')
|
||||
}
|
||||
});
|
||||
io.addEventListener('sceneSwitch', (e)=>{
|
||||
console.log(e);
|
||||
this.scenesList = [this.scenes.find(s=>s.data.id == e.scene)]
|
||||
})
|
||||
}
|
||||
loaded += 1/this.scene.data.items.length
|
||||
|
||||
Reference in New Issue
Block a user