- Home /
Inherit from EventTrigger
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)
{
Debug.Log("OnBeginDrag called.");
}
}
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.
Answer by PascalHc · May 18, 2020 at 11:32 AM
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?
Your answer
Follow this Question
Related Questions
An OS design issue: File types associated with their appropriate programs 1 Answer
C# inheritance advice 2 Answers
Access local method variable in derived class 2 Answers
Inheritance structure 0 Answers
Button is not being clicked. 1 Answer