Unity3D:带输入的 UnityEvent 未出现在编辑器中
Unity3D: UnityEvent with inputs does not appear in editor
有谁知道如何让复杂的 UnityEvent 出现在编辑器中?
public class Test : MonoBehaviour
{
public UnityEvent myEvent;
public UnityEvent<string> myAnotherEvent;
}
myEvent 看起来很好,但 myAnotherEvent 没有。
提前致谢。
UPD 还尝试重写 UnityEvent,例如:
public class NewEvent : UnityEvent<string>
{
}
public class Test : MonoBehaviour
{
public UnityEvent myEvent;
public NewEvent myAnotherEvent;
}
似乎没有帮助。
[System.Serializable]
public class NewEvent : UnityEvent<string>
{
}
public class Test : MonoBehaviour
{
public NewEvent myAnotherEvent;
}
您需要告知您的新 class 是可序列化的。
有谁知道如何让复杂的 UnityEvent 出现在编辑器中?
public class Test : MonoBehaviour
{
public UnityEvent myEvent;
public UnityEvent<string> myAnotherEvent;
}
myEvent 看起来很好,但 myAnotherEvent 没有。
提前致谢。
UPD 还尝试重写 UnityEvent,例如:
public class NewEvent : UnityEvent<string>
{
}
public class Test : MonoBehaviour
{
public UnityEvent myEvent;
public NewEvent myAnotherEvent;
}
似乎没有帮助。
[System.Serializable]
public class NewEvent : UnityEvent<string>
{
}
public class Test : MonoBehaviour
{
public NewEvent myAnotherEvent;
}
您需要告知您的新 class 是可序列化的。