hi,
i’d like to make a custom editor gui for a monobehaviour script like the one in the UI->Button component for the OnClick() where you can fill a list of object and select the method they contain.
any idea how to do that ?
hi,
i’d like to make a custom editor gui for a monobehaviour script like the one in the UI->Button component for the OnClick() where you can fill a list of object and select the method they contain.
any idea how to do that ?
You have to define a CustomEditor. Read up on them here, or check out the official tutorial video here.
i’ve seen those but what about exposing a script methods as in the UI buttons editor ?
Those are “UnityEvents”. You don’t need a custom editor; you just need to add a UnityEvent variable to your script and it should show up automatically, then you can drag/drop an object onto it and select a method. Docs here: http://docs.unity3d.com/ScriptReference/Events.UnityEvent.html
ok, thanks, i’m a bit confused between PropertyDrawer, CustomEditor, etc… but at least, i managed to get the methods of a script as a popup.