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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Resolution Note:
These use cases are known and are planned for the future.