Using vanilla public UnityEvent classes will work just fine through the Inspector…
Now I want to pass some information along with it as well and doing something like:
public UnityEvent<bool> MyInvokableEvent;
Will not show up in the inspector anymore. I want this to be assignable through the editor component inspector… through code this seems to work fine (the Invoke call is carrying over the arg list), but this serves no use when building systems for non developers to work with.
Is there any way to allow wiring up these methods that have arguments through the inspector?
Hi, hopefully you’ve figured this out since the original posting, but for anyone else who comes across this (like I did), I found the answer here.
The short answer is, you need to declare an event class inheriting from UnityEvent and make sure it has the [Serializable] attribute, then in your script you’ll have “public CustomClass MyInvokableEvent;”