- Home /
Question by
a_savinov · Aug 19, 2018 at 10:00 PM ·
guieditoreditor-scriptingeditorwindoweditorgui
Editor GUI Foldout header style customization
Hello. I'm trying to stylize EditorGUILayout.Foldout header for EditorWindow like below:
Please, help to do that "like button" foldout with buttons inside and arrows.
Now I have this (dark or light editor theme doesn't matter)
with the code:
void DrawLevelFoldout(int index) {
var element = Config.Levels[index];
GUILayout.BeginHorizontal();
Foldouts[index] = EditorGUILayout.Foldout(Foldouts[index],
Config.Levels[index].Name, true);
if (GUILayout.Button("Delete", GUILayout.Width(100))) {...}
if (GUILayout.Button("Up", GUILayout.Width(50))) {...}
if (GUILayout.Button("Down", GUILayout.Width(50))) {...}
GUILayout.EndHorizontal();
if (Foldouts[index]) {
element.Name = EditorGUILayout.TextField("Name", element.Name);
element.Background =
(GameObject) EditorGUILayout.ObjectField("Background Prefab", element.Background, typeof(GameObject), false);
}
}
Comment