You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At various times we need to assign SceneCamera to objects so they can receive worldspace clicks. But the SceneCamera appears to be created multiple times on scene / layout load.
As a result, this happens:
SceneCamera is created for first time
OurClass.Canvas.worldCamera is assigned the SceneCamera.Camera
First SceneCamera is destroyed for some reason
Second SceneCamera is created
OurClass.Canvas.worldCamera is now set to an invalid camera
We patched this by checking the worldCamera for validity during the Update() loop, but that feels hacky.
Is there an event we can watch to know when the scene is done updating cameras? I tried AfterLayout but it doesn't help here
Also, is there a diagram somewhere showing the event sequences for when a scene loads or a layout changes? That would be helpful in understanding where we can hook into things.
SceneCamera created twice on initial editor load
I detected these events by pausing when gameObject.name == "SceneCamera"
At various times we need to assign SceneCamera to objects so they can receive worldspace clicks. But the SceneCamera appears to be created multiple times on scene / layout load.
As a result, this happens:
We patched this by checking the worldCamera for validity during the Update() loop, but that feels hacky.
Is there an event we can watch to know when the scene is done updating cameras? I tried AfterLayout but it doesn't help here
Also, is there a diagram somewhere showing the event sequences for when a scene loads or a layout changes? That would be helpful in understanding where we can hook into things.
SceneCamera created twice on initial editor load
I detected these events by pausing when gameObject.name == "SceneCamera"
Scene Camera created twice on layout change
The text was updated successfully, but these errors were encountered: