- Home /
Can you have custom EditorGUILayout fields?
In other words, can you have sub-classes within the GUI Editor?
I am making a screen manager, and I want the screens to be editable within the GUI Editor. The screen manager contains a list of screens. And the screens contain a list of, for example, buttons.
So I want the editor to basically look like this:
Screen Manager
Screens
How many? 3 >Screen 1
>Buttons
>How many? 3 >>Button 1
>>>Button 1 properties
Button 2
>>>Button 2 propertiesButton 3
Button 3 properties
Screen 2
>Buttons
>How many? 0
>Screen 3
>Buttons
>How many? 0
I have my ScreenManager showing all my Screens, but I don't know how to make the Screens display THEIR properties in the same Editor window. Is it even possible?
I have this to show my list of Screens in the ScreenManager:
for (int index = 0; index < screens.Count; ++index)
{
>ScreenInstance data = screens[index];
>data = (ScreenInstance)EditorGUILayout.ObjectField("Screen " + index + " : ", data, typeof(ScreenInstance));
}
Any and all tips are appreciated!
Your answer
![](https://koobas.hobune.stream/wayback/20220613072144im_/https://answers.unity.com/themes/thub/images/avi.jpg)