Sadly the documentation is not very helpful but here is how it works.
First you have to include the event namespace
using UnityEngine.Events;
Then you can define your event:
public UnityEvent myevent;
That should bring up the ui seen in your image.
If you like to invoke your event you can do it like this:
if (myevent != null) {
myevent.Invoke();
}
http://docs.unity3d.com/ScriptReference/Events.UnityEvent.html
if you like to use events with parameter you have to define them via a custome class like this
[System.Serializable]
public class MyIntEvent : UnityEvent
{
}
Then you can create a variable of that custom event type
public MyIntEvent m_MyEvent;
↧