Search Issue Tracker
Fixed
Fixed in 6000.2.6f1, 6000.3.0b4, 6000.4.0a2
Votes
1
Found in
6000.2.6f1
6000.3.0b3
6000.4.0a1
Issue ID
UUM-119437
Regression
Yes
InitializeOnLoadMethod is called before scenes gets loaded after project upgrade
Steps to reproduce:
1. Create a new project in 6000.2.5f1
2. Create a new script
3. Add the following code:
[InitializeOnLoadMethod]
static void LoadMethod()
{
Debug.Log("InitializeOnLoadMethod called");
Debug.Log("EditorBuildSettings.scenes length: " + EditorBuildSettings.scenes.Length);
}
4. Wait for editor to recompile
5. Observe the console
6. Upgrade the project to 6000.2.6f1
7. Observe the console
Actual results:
0 Scenes are loaded in EditorBuildSettings.scenes.Length when using [InitializeOnLoadMethod] attribute
Expected results:
All required scenes are loaded in EditorBuildSettings.scenes.Length when using [InitializeOnLoadMethod] attribute
Reproducible with versions:
6000.2.6f1, 6000.3.0b3
Not reproducible with versions:
6000.2.5f1, 6000.3.0b2
Tested on (OS):
MacOS Sequoia 15.6.1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Android][iOS][UnityPlayerActivity] Legacy InputField.onEndEdit is not called when ending text edit
- Transform corruption and/or crash on PhysX::CreateCharacterController when spawning physics objects into Prefab stages
- UNITY_EDITOR data is Serialized into AssetBundle when building on the active Build Target
- "TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations..." error when changing the Packages "Cache Location" folder
- CompilationPipeline.assemblyCompilationFinished() hangs unity when reloading domain
Resolution Note (fix version 6000.4.0a2):
Verified fixed in 6000.4.0a2 using InitializeRepro. All required scenes are loaded in EditorBuildSettings.scenes.Length when using [InitializeOnLoadMethod] attribute
Resolution Note (fix version 6000.2.6f1):
Verified fixed in 6000.2.6f1 using InitializeRepro project. All required scenes are loaded in EditorBuildSettings.scenes.Length when using [InitializeOnLoadMethod] attribute