Search Issue Tracker
Fixed in 5.4.1
Votes
0
Found in
5.4.0b4
Issue ID
767792
Regression
No
SceneManager.onSceneLoaded not called on the first frame when added in RuntimeInitializeLoadType.BeforeSceneLoad
Reproduction steps:
1) Open project "LoadEventBug"
2) Open scene "Demo"
3) Play the scene.
--- Note that "init" is logged to the console.
--- Note that "loaded" is not.
--- This is despite the Init function supposedly being called before the onSceneLoaded event is fired
Code:
public class Test : MonoBehaviour
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void Init()
{
Debug.Log("init");
SceneManager.sceneLoaded += LevelWasLoaded;
}
private static void LevelWasLoaded(Scene scene, LoadSceneMode mode)
{
Debug.Log("loaded");
}
}
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Profiler - Taking you to the wrong section when using 'show'
- Draw Renderers custom pass doesn't work with SSGI
- WebCamTexture does not set the requested resolution when used in WebGL
- Editor default Stylesheet/Matching Selector buttons in Debugger don't do anything
- Graphics.DrawMeshNow stops rendering Render Texture after a few frames when viewed in the Player
Add comment