vexe / VFW

MIT License
492 stars 67 forks source link

Is it possible to draw the default drawer of an object using RabbitGUI? #104

Open oxysoft opened 7 years ago

oxysoft commented 7 years ago

I have a window which extends BetterWindow and I'm using the gui object to create something a bit like an inspector. I have a list that I'd like to display but currently, it looks like I may have to write my own code for rendering the list. Is it possible to somehow leverage the existing code in VFW which renders the list drawer?

oxysoft commented 7 years ago

After doing some searching around, it looks like it would be possible with the Member function of BaseGUI but it takes an EditorMember which I'm not sure how to get

vexe commented 7 years ago

I should have an example there for custom stuff in a Window, check the examples folder it should be there.

Yeah you have to use that .Member function IIRC. You create the member via Member.Create, you give it your target object (the window in this case), the field/property/function name and a unique id used internally for persisting foldouts etc.

vexe commented 7 years ago

Here's the file. Looks like I was doing it a different way, both are possible though.

https://github.com/vexe/VFW/blob/master/Assets/VFW%20Examples/Editor/DrawersInEditorWindowExample.cs