Search Issue Tracker
By Design
Votes
0
Found in
5.3.4p6
Issue ID
798876
Regression
No
"UnityEditor.InitializeOnLoad" calls the constructor twice when the Editor opens
Steps to reproduce:
1. Download and open attached project.
2. Notice that the "Console" window outputs this message twice:
"NewBehaviourScript cctor()
UnityEngine.Debug:Log(Object)".
It indicates that the constructor of "NewBehaviourScript" object is called twice.
3. Re-import all the assets or enter the Play mode.
4. Notice that this message is output once.
Expected result: when the Editor starts the constructor of the object should be called once.
Actual result: when the Editor starts the constructor of the object is called twice.
Note: with some versions of Unity the constructor of the object is called three times when the Editor opens.
Reproduced with:
5.3.2f1, 5.3.4p6, 5.3.5f1, 5.4.0b18.
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
StephenHodgson-Valorem
Jun 12, 2017 21:12
Why is this by design?
bknight808
Dec 06, 2016 19:08
Still happening in 5.5.0f3 with a new project that contains only one script.
http://screencast.com/t/lkhKnkrpPB
Pelerin88
Jul 01, 2016 13:44
reproduces with 5.3.5p6
Pelerin88
Jul 01, 2016 13:44
reproduces with 5.3.5p4