Do I destroy a scene like I destroy gameobjects in TS? Because my scene Is gone when I call DeactivateScene()
but loadedSceneInstance still has data in it. Do I just manually set it null or is there further cleanup necessary?
// @type UnityEditor.SceneAsset
@serializable(AssetReference)
scene: AssetReference | null = null;
loadedSceneInstance? : Object3D;
public async ActivateScene() {
if (!this.scene?.isLoaded()) {
await this.scene.loadAssetAsync();
if (this.loadedSceneInstance) {
this.loadedSceneInstance = await this.scene.instantiate();
}
}
public async DeactivateScene() {
if (this.loadedSceneInstance != null)
GameObject.destroy(this.loadedSceneInstance, true, true);
if (this.scene.isLoaded()) {
await this.scene.unload();
}
}
by user 334342083445784576