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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Add comment