Search Issue Tracker
Won't Fix
Votes
0
Found in
5.4.1f1
Issue ID
846907
Regression
No
Method with [RuntimeInitializeOnLoadMethod()] attribute with "BeforeSceneLoad" parameter is not invoked before scene load
Method with attribute [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType loadType)] with parameter "RuntimeInitializeLoadType.BeforeSceneLoad" is not invoked before scene load
To reproduce:
1. Open the project attached by the user
2. Open the console window
3. Attach the only script in the project to any object in the Hierarchy
3. Enter play mode
4. Notice the order of the messages appearing in the console
In Editor everything is working as expected and OnAfterDeserialize() is called after user's method EditorInitializeOnLoad() with attribute [UnityEditor.InitializeOnLoadMethod] Initializes a GameObject
5. Build the project in development mode and run it
6. Notice the messages in the console
Comparing them to the ones in the editor it is obvious that the order in which the methods were called is wrong as OnAfterDeserialize() is called before user's method
RuntimeInitializeOnLoad() was called even though it has Attribute [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType loadType)] with parameter "RuntimeInitializeLoadType.BeforeSceneLoad"
Reproduced on: 5.6.0a1, 5.5.0b10, 5.4.2p2, 5.3.6p7
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on GUIManager::DoGUIEvent when focusing on the Game view window on a specific project
- Asset creation in the Project Browser is not always undone/inconsistent when the undo shortcut is pressed right after creating an asset
- JobTempAlloc memory leak warning is thrown when the Player is shut down
- Graphics State Collection warm-up does not work when using with Addressables Shaders
- "Baked Shadow Radius" field is visible but inactive when when the Shadow Type is set to "Hard Shadows" under the Light Component
Add comment