- Home /
Question by
TimothyAppel · May 29 at 02:25 PM ·
c#editor-scriptingattribute
Get Method Of Class That Has An Attribute
So I have an "OnChanged" custom attribute that i want to use to call a function when a value has been changed in the inspector:
in the image the part i have highlighted is where I'd like to invoke the passed in method.
Any ideas?
onchangedattribute.png
(250.6 kB)
Comment
The OnGUI function gives us access to the SerializedProperty that the attribute is editing, so is there maybe a way to get the class that the SerializedProperty belongs to and then from there use System.Reflection to get the method that i want to invoke?
Your answer
![](https://koobas.hobune.stream/wayback/20220613061128im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Serializable settings for custom PropertyDrawer 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Generic CustomEditor 1 Answer
Select which component is dragged into a public variable. 0 Answers