{{ message }}
Problem with scene managment #387
Replies: 3 comments 1 reply
-
|
example from website include only situation, when someone have load scene, and game scene. https://enable3d.io/examples/project-options-and-multiple-scenes.html :( |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Maybe you have misses the "key" in the constructor? This works: (or do I miss something) import { PhysicsLoader, Project, Scene3D } from 'enable3d'
class SceneGreen extends Scene3D {
constructor() {
super({ key: 'SceneGreen' })
}
async create() {
console.log('create SceneGreen')
this.warpSpeed()
this.physics.add.box({ y: 2 }, { phong: { color: 'green' } })
setTimeout(() => {
this.start('SceneRed')
}, 2000)
}
}
class SceneRed extends Scene3D {
constructor() {
super({ key: 'SceneRed' })
}
async create() {
console.log('create SceneRed')
this.warpSpeed()
this.physics.add.box({ y: 2 }, { phong: { color: 'red' } })
setTimeout(() => {
this.start('SceneGreen')
}, 2000)
}
}
PhysicsLoader('/lib', () => new Project({ scenes: [SceneGreen, SceneRed] })) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
the problem was in enable3d engine, but for my own purposes i made a fork and fix it - we can close this theard |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Imagine a situation where we have many different scenes. These scenes have many of their own resources to load - with their own init, create functions, etc.
The problem is that when I run the application with two or more scenes like this:
scenes: [MainScene, SecondScene], all the scenes load and render at the same time.What should I do to prevent this situation and be able to manage the lifetime of each scene?
Beta Was this translation helpful? Give feedback.
All reactions