Question by
Thompson11 · May 16, 2018 at 11:23 AM ·
c#editor-scriptingevents
Pre-populated UnityEvent style list from GetComponents on GameObject
Hello, I am using an Event System and want to activate methods (with params) on a GameObject, from the Inspector. I could use a UnityEvent and drag the GameObject onto itself and select the methods there, but wondered if I could cut out a step and have a populated list of methods from the Monobehaviours on the GameObject.
I can get a list of MonoBehaviours and a list with Methods within that, (with Paramaters) using Reflection. Then I could make a custom editor script, etc.
This however feels like I am reinventing the wheel, I wondered if anyone had any resources that have done this? Unity store links? Or can give me a reason why I shouldn't bother.
Kind Regards, Ian
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612162759im_/https://answers.unity.com/themes/thub/images/avi.jpg)