The ISceneEventListener is called by the SceneSwitcher when a scene is loaded or unloaded.
It must be added to the root object of your scene (that is being loaded) or on the same object as the SceneSwitcher
It can be used to e.g. smooth the transition between scenes or to load additional content when a scene is loaded.
// Add this component to the root object of a scene loaded by a SceneSwitcher or to the same object as the SceneSwitcher exportclassMySceneListenerimplementsISceneEventListener { asyncsceneOpened(sceneSwitcher: SceneSwitcher) { console.log("Scene opened", sceneSwitcher.currentlyLoadedScene?.uri); } }
The ISceneEventListener is called by the SceneSwitcher when a scene is loaded or unloaded.
It must be added to the root object of your scene (that is being loaded) or on the same object as the SceneSwitcher
It can be used to e.g. smooth the transition between scenes or to load additional content when a scene is loaded.
Example