Reply To: Custom ReflectedFieldInspector types

NodeCanvas Forums Support Custom ReflectedFieldInspector types Reply To: Custom ReflectedFieldInspector types

#13189
Gavalakis
Keymaster

Hello,

To avoid hacking the source code, the proper way is to [Create Custom Object Drawers].
Please take a look at the [Documentation for Creating Custom Object Drawers], but in short, you simply need to create a class like the following (remember that this is a Unity Editor only functionality, thus to wrap it into an #if UNITY_EDITOR define).

ObjectDrawer class also has some important inherited properties that you might want to use:

Thus, if in your case, you already have created GUI Editors for your classes (like for example ActionFlowField), you could do something like this:

Or, you could move the code from your ActionFlowField method, into the OnGUI method of the ActionFlowFieldDrawer class, if it is only used within the context of NodeCanvas.

Please let me know if that works for you.
Thanks!

Join us on Discord: https://discord.gg/97q2Rjh