Search Issue Tracker
Won't Fix
Votes
1
Found in
2017.4.0f1
2018.4.0f1
2019.2.0a1
2019.2.0f1
2019.3.0a1
2020.1.0a1
Issue ID
1186416
Regression
No
OnEnable is called when changing any selected GameObject's Setting in Inspector Window
How to reproduce:
1. Open user's attached project (InspectorCallbackBug.zip)
2. Open "SampleScene" Scene
3. Select "GameObject" GameObject
4. In Inspector Window change Mesh Renderer's Component Material
Expected result: OnEnabled is called only when selecting a GameObject
Actual result: OnEnabled is called every time something is done with GameObject (See Debug.log in Console Window)
Reproducible with: 2017.4.32f1, 2018.4.10f1, 2019.2.6f1, 2019.3.0b5, 2020.1.0a5
Notes:
1. OnEnable is called when selecting a GameObject while it is not active
2. Adding other Components to the GameObject causes the issue as well
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
- Enabling “Editor Extension Authoring” in UI Builder doesn’t dirty the document and saving with shortcut doesn’t persist the state
- WebRequest.Create() function fails with "URI prefix is not recognized" errors when the project is built for Linux Standalone or Windows Dedicated Server
- “GUIStyle” and “NullReferenceException” errors thrown in the Console when opening Object Field during script compilation
- Reflections are visible on objects without Recursive Rendering when viewed through transparent parts of another object with Recursive Rendering and Alpha Clipping enabled
- Visual artifacts appear when using "clip" method in custom shader and running on GLES
Resolution Note (2020.1.X):
This is the expected behavior when changing properties that are displayed as components. Changing the property will result in a call to OnEnable to properly rebuild the inspector UI.