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
- Console displays "ArgumentException: Cannot unschedule unknown scheduled function UnityEngine..." error after the "Audio Random Container" closing
- [Ubuntu] Asset Bundles Dropdowns Contain Empty Row in Inspector
- Symbols are generated for a third-party native plug-in with 'Shared Library Type' set to 'Executable' when building for Android
- "Search by Import Log Type" Icon Nearly Invisible in Light Theme (Project Window)
- [Android] Realtime Directional Light turns off when there is no realtime shadow caster in the view
Add comment