I’m trying to create a class that inherits from EventTrigger and besides has a public variable.
public class NumberOnCanvas : EventTrigger
public float f;
public override void OnBeginDrag(PointerEventData data)
However all I can see in the inspector is this
Am I doing something wrong ? Can this be done only using customEditor ? Thanks in advance.
Yes, since you are trying to intercept calls to OnBeginDrag() you need to inherit from IBeginDragHandler. This is because you are trying to use an Interface. See the this post for more information link text
As far as I understand, you want an editable float ‘f’ showing up in the inspector.
@agodinez , did you find an answer to this?
My guess is a custom editor written for the EventTrigger class. This doesn’t include your variable and it’s not showing up.
I’ve got the same issue and tried to write my own editor script, which works as far as my own variables are showing up now, but those of the EventTrigger class aren’t.
Has anyone a solution for this problem? How can I make the public properties of EventTrigger AND my own showing up in the inspector?