Reputation: 319
Does anyone know how make complex UnityEvent appear in editor?
public class Test : MonoBehaviour
{
public UnityEvent myEvent;
public UnityEvent<string> myAnotherEvent;
}
myEvent appears just fine, but myAnotherEvent does not.
Thanks in advance.
UPD Also tried to override the UnityEvent like:
public class NewEvent : UnityEvent<string>
{
}
public class Test : MonoBehaviour
{
public UnityEvent myEvent;
public NewEvent myAnotherEvent;
}
didn't seem to help.
Upvotes: 1
Views: 131
Reputation: 10701
[System.Serializable]
public class NewEvent : UnityEvent<string>
{
}
public class Test : MonoBehaviour
{
public NewEvent myAnotherEvent;
}
You need to inform that your new class is serializable.
Upvotes: 1