Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2022.3.2f1
2023.1.0f1
2023.2.0a18
Issue ID
UUM-39959
Regression
No
Custom editors are recreated when assigning a material to a GameObject
Reproduction steps:
1. Open project “Bug Test 2.zip”
2. Open scene “Test”
3. Select “Cube” GameObject in the Hierarchy
Expected result: only one “Hello i am a new editor” message is printed in the Console
Actual result: “Hello i am a new editor” messages are flooded in the Console - when a custom editor assigns a material to an object it is constantly remade
Reproducible with: 2022.3.2f1, 2023.1.0f1, 2023.2.0a18
Couldn’t test with: 2021.3.27f1 (due to compiler errors)
Reproducible on: macOS Ventura 13.2.1 (Intel), Windows 10 (by the reporter)
Note: Commenting out line 18 in “NewBehaviourScript.cs” gives expected results
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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
Editors are currently recreated when the inspected object is marked as dirty. Changing the material of an object will cause the object to dirty itself and may trigger the construction of a new editor.
Unity will recycle the editors to some extent, but there's no guarantee that the same instance will be used for a particular object.
Resolution Note (2023.2.X):
Editors are currently recreated when the inspected object is marked as dirty. Changing the material of an object will cause the object to dirty itself and may trigger the construction of a new editor.
Unity will recycle the editors to some extent, but there's no guarantee that the same instance will be used for a particular object.