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
- Popup windows spawn on the incorrect monitor when the Editor is placed near the boundary of scaled monitor next to a monitor with different scaling
- Hidden Tabs do not shift into empty space after closing visible Tabs
- [Android] Application not deployed on a device when "activity-alias" is used in the AndroidManifest
- Shader compile process adds shader ID to the constant buffer name when the word "Globals" is being used in Vulkan
- Audio Mixer Snapshot link to the documentation isn’t working
Resolution Note:
These use cases are known and are planned for the future.