Search Issue Tracker
Won't Fix
Won't Fix in 2023.1.X
Votes
0
Found in
2020.3.36f1
2021.3.5f1
2022.1.7f1
2022.2.0a18
2023.1.0a3
Issue ID
UUM-8250
Regression
No
OnClick event can use private method when that method is assigned before being made private
Reproduction steps:
1. Open the attached project "BugRepro.zip"
2. Open "SmpleScene" Scene
3. Enter Play mode and click on the button in the Scene
4. Observe the Console
Expected result: Nothing or errors are printed in the Console
Actual result: "Testing" is printed in the Console
Reproducible with: 2020.3.36f1, 2021.3.5f1, 2022.1.7f1, 2022.2.0a18, 2023.1.0a3
Notes:
- Only public method can be added to OnClick event
- Method that is already added and its access specifier is changed to private/protected is not removed and is usable by the event
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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
Resolution Note:
We dont continually scan for methods hooked up and their visibility. As the system works on serialization once its known we dont unhook it.
There is also a use case of assigning a callback to a private function in the same class and that should work which leave us with no identifiable information to remove the callback..
Resolution Note (2023.1.X):
We dont continually scan for methods hooked up and their visibility. As the system works on serialization once its known we dont unhook it.
There is also a use case of assigning a callback to a private function in the same class and that should work which leave us with no identifiable information to remove the callback..