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
- Tile Palette grid is moved after entering Play Mode
- Tile Palette Edit mode turns off in Play Mode
- The Editor crashes when Generating Font Atlas in the Font Asset Creator with “9999999999” padding and 256x256 Atlas Resolution
- [iOS] An “ArgumentNullException” error is thrown when GetIntroductoryPriceDictionary() method is called
- Font Import Settings documentation page is missing when the documentation button is pressed in the Inspector window
Add comment