- Home /
Extending unity component and Adding listener?
Hello,
I would like to extend InputField component so that when the edit is done it calls another function.
Unity allows to subscribe to event by onEndEdit.AddListener(FunctionName) from outside, how can I do this from the inside (as I am extending)?
Regards.
Answer by DiegoSLTS · May 28, 2016 at 03:05 PM
That AddListener line works from the inside too. If you extend InputField you can access the onEndEdit event since it's a public field of InputField, and derived class inherit all the public and protected fields.
But your question is weird, it sounds like you're adding a feature that already exists, that's what onEndEdit is used for.
Your answer
![](https://koobas.hobune.stream/wayback/20220612081720im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Menu Component/MaterialUI/EZAnim can't be checked because doesn't exist 2 Answers
Unity5 WheelCollider UI not showing???? 4 Answers
Only one Child Component turning off. 2 Answers
iPhone UI Components? 2 Answers