Search Issue Tracker
Fixed in 2017.1.0f3
Votes
2
Found in
5.6.0f3
Issue ID
897146
Regression
Yes
When Image component is added to a child through script, methods OnEnable() and OnDisable() are called
There is an attached project with a script, which creates 10 child objects and add Image component to them. Also there are OnEnable and OnDisable methods, which outputs an error message to the console. They both are called 10 times after pressing play. They are not called, except for initial OnEnable, if the line which adds Image component is commented.
Reproduction steps:
1. Open attached project
2. Press play
3. See the console output
Expected: 1 message in the console
Actual: 21 messages in the console
Not reproduced on: 5.6.0b7
Reproduced on: 5.6.0b8, 5.6.0f3, 2017.1.0a6
Regression introduced on: 5.6.0b8
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
- Search field in UI Builder's Library has no character limit
- Changing the value in UI Builder by dragging increases it by a few thousand points when reaching the borders of the screen
- ARM64 architecture DLL incorrectly copied instead of x64 when building for Windows x64
- Crash on TypeTreeIterator::GetNode when opening a specific folder
- Crash on WriteSerializedAssetsV2 when (re)entering the Play Mode in a specific project when IEnumerator Start() is used
TrialByFun
Apr 05, 2017 16:55
From what I can tell, it also calls OnEnable and OnDisable on all children AND their parent canvas, and the canvas's parent in turn. Will add a Example project when I get a moment.