Hi all. I am sorry if this is too general but the docs don’t provide enough for me to grasp this. I understand Unityaction is equivalent to .net action. Is there an equivalent to Unityevent? I am trying to get at how it would be useful. Thanks
UnityEvent is just a standardized sort of callback (C# delegate) with built-in – and really cool – support in the Unity editor. This means that you can declare a public UnityEvent on your script, and then in the editor, make this invoke almost any public method or set almost any public property on any component of any object in the scene.
This is a really powerful way to decouple your components. The sender of the event doesn’t need to know anything about the receivers, and vice versa.
I just discovered UnityEvent tonight, and I feel it plugs a major gap in the whole component architecture. I wrote a forum thread about it here, with some examples.