Unity Issue Tracker - Method ran with RuntimeInitializeOnLoad is executed last when running an overload of the method and declaring it above the RuntimeInitializeOnLoad method
Fixed
UUM-53659
Method ran with RuntimeInitializeOnLoad is executed last when running an overload of the method and declaring it above the RuntimeInitializeOnLoad method
Unity: Mono
Open
6.0.X
Fixed
2023.3.X
2022.3.X
2021.3.X
Won't Fix
6.2.X
6.1.X
2023.2.X
2023.1.X
Closing this port since this issue should've gotten fixed prior to us shifting to new trunk and that if it's a mistake please re-open.
Closing this port since this issue should've gotten fixed prior to us shifting to new trunk and that if it's a mistake please re-open.
Cancelling this 2023.2 tech release issue since the support for this release has come to end of life. Cancelling this 2023.2 port case does not affect any LTS or Unity 6 Beta/Preview that remain open.
How to reproduce:
1. Open the attached “RuntimeInitializeOnLoad.zip“ project
2. Open the “SampleScene“ Scene
3. Enter Play Mode
Expected result: "Tagged method" is logged in the Console
Actual result: “RefTypeTest“ is logged in the Console
Reproducible on: macOS 14.0 Sonoma (Intel)
Not reproducible on: No other environment tested
Notes:
Also reproducible in Player
The first declared overload is always called no matter the amount of overloads
The user reported that commenting out the “RefTypeTest” method or moving it below the “ValueTypeTest” method and entering Play Mode, caused the Editor to hang, but when testing, the Editor didn’t hang, instead the “NullReferenceException: Object reference not set to an instance of an object“ error appeared in the Console
Prioritise and Follow this issue
Have a workaround or additional info about this issue?