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
-
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note:
These use cases are known and are planned for the future.