added ambient sound feature
This commit is contained in:
@@ -100,7 +100,7 @@ export default {
|
||||
|
||||
async expandScenarioData(scene){
|
||||
const promises = [];
|
||||
['environment', 'scene', 'intro'].filter(e=>scene.data[e]).forEach(e=>{
|
||||
['environment', 'scene', 'intro', 'audio'].filter(e=>scene.data[e]).forEach(e=>{
|
||||
promises.push(this.$api.gameObject.load(scene.data[e]).then(r=>scene.data['$'+e] = r.data))
|
||||
})
|
||||
|
||||
@@ -130,6 +130,10 @@ export default {
|
||||
if (this.scene.data.$environment){
|
||||
await gameEngine.loadPanorama(this.scene.data.$environment.asset.name);
|
||||
}
|
||||
if (this.scene.data.$audio){
|
||||
await gameEngine.playAmbientSound(this.scene.data.$audio.asset.name);
|
||||
gameEngine.ambientSound.setVolume( 0.5 );
|
||||
}
|
||||
if (this.scene.data.$scene){
|
||||
let env = await gameEngine.load(this.scene.data.$scene.asset.name);
|
||||
this.setObjectAttributes(l, this.scene.data, env.scene, env, 100);
|
||||
@@ -194,7 +198,7 @@ export default {
|
||||
});
|
||||
if (finished == expectToFinish){
|
||||
//GO TO NEXT LEVEL
|
||||
|
||||
console.log('LEVEL FINISHED')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user