Feature Request: enumerations as allowed functions parameter

This is a request I would like to make: it will be very useful if the parameter of the functions linkable to the UI components, could accept enumerations.

Hope you will take this request in consideration.

Thank you very much :slight_smile:

1 Like

+1

I started using UnityEvents with the beta (before I used Signals from unitypatterns for the same thing) and use it everywhere now, not only for UI, it’s very powerful and simple to use. A small, but nice step towards native visual scripting!

Some more suggestions:

  • it would be nice if custom events invoked with a parameter ( UnityEvent anEvent; ) show up in the inspector, so we could connect functions that accept the right argument type, without setting the parameter manually.
  • there should be a way to hide events, they use a lot of space even when the list is empty (especially in b21). At least the display should take the current ident position into consideration (events are currently always full width of the inspector)
  • It should be possible to select (custom) properties and not only functions. While it’s already possible to e.g. set .enabled to a value in a event, the same thing is not possible for a custom defined public variable or property.

After that, the next step would be to allow connecting references of properties directly to fields of the same type. So we could connect not only a GameObject as a parameter but also reference to a property like the name of a GameObject directly as a string parameter of an event.

And there would be even more possible: These references could not only be useful in events, but everywhere in the inspector:
For example a float property of ScriptA connected to a float field of ScriptB would automatically update the value on change, which would allow a lot of simple “scripting” without writing any code. I know there are visual scripting tools around, but I’d love to see the inspector slowly moving into this direction to allow simple connections between objects this without writing code and without using any external tools.

1 Like

While we’re at it: I would like the ability (even if it takes specialized code) to change Animator values (bool, int, float) from a UnityEvent.

It seems like my third point (show all properties, including custom ones) is actually already working, but only if it is a property with public getter and setter. Public variables are not listed.