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
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
- Scene view has Y coordinates of the Screen Position node flipped when some of the URP features are disabled
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
Resolution Note:
These use cases are known and are planned for the future.