Question by
Calm · Oct 09, 2018 at 12:36 AM ·
camerascene-loadingscene-switchingscene change
Camera not rendering on UnloadSceneAsynch
I have 2 Cameras in the "Main" scene. One displays the map and the other displays a GUI on the bottom. I have 1 Camera in the "Combat" scene.
The methods I'm using are
public void LoadCombatScene() {
//1 = "Combat"
SceneManager.LoadSceneAsync(1, LoadSceneMode.Additive);
MapCamera.enable = false;
GUICamera.enable = false;
}
public void UnloadCombatScene() {
SceneManager.UnloadSceneAsync("Combat");
MapCamera.enable = true;
GUICamera.enable = true;
}
The "Combat" scene loads over the "Main" scene. The camera in the combat window automatically takes over. When I call UnloadCombatScene() the "Combat" scene closes out, The "Main" MapCamera renders correctly, but the GUICamera is still showing what the Combat Camera was rendering.
Not sure what I'm doing wrong. anyone help? Is this enough information?
Comment
Is this enough information?
No.
You should switch to Event for UI stuff. It much easier to handle than use banana code. https://unity3d.com/learn/tutorials/topics/scripting/events-creating-simple-messaging-system