Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
0
Found in
2019.4
2020.3
2020.3.0f1
2021.2
2022.1
2022.2
Issue ID
1394546
Regression
No
Enum, Long, Double, Decimal, byte, or char values are not available when used in Events
How to reproduce:
1. Open the user's attached project
2. Open scene Scenes/SampleScene
3. In the Hierarchy window, select "GameObject"
4. In the Inspector window, under the Test Activator (Script) component, change the TestReciever.RecieveInt method by selecting the field
5. Observe the available methods under TestReciever
Expected result: RecieveLong, RecieveDouble, RecieveDecimal, RecieveByte, RecieveChar, RecieveEnum methods are available
Actual result: only the RecieveInt method is available
Reproducible with: 2019.4.36f1, 2020.3.30f1, 2021.2.15f1, 2022.1.0b11, 2022.2.0a7
Comments (1)
-
unity_vhwR5LxKQZuFcg
Mar 02, 2022 15:05
The underlying reason is because the UnityEventBase internal method
internal MethodInfo FindMethod(string name, object listener, PersistentListenerMode mode, Type argumentType)
only validates listener method parameter types that match those found in the enum PersistentListenerMode:
void, Object, int, float, string, and bool.Doubles, decimals, bytes, chars, and enums match none of those.
There are also several "register" methods (eg RegisterBoolPersistentListener) that match the allowed types.
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
- Unity Cloud icon does not appear next to project and does not connect correctly when the project is created with Cloud but closed right after creation
- ScrollerSlider in the Scroller Control is still using UXMLTraits
- Crash on ExtractHandles when shutting down the Editor in a specific scene while Burst jobs are in progress
- Unity Hub closes with no "Project is currently open" window when selecting an already open project from the Projects list
- The Hub freezes indefinitely when copy/pasting a lot of characters in the “Set project display name” Hub window since it has no character limit
Resolution Note:
These use cases are known and are planned for the future.