- Home /
Custom Style EditorGUI
It seems that EditorGUI components behave strangely when using a custom GUI Skin. A field would show a blue selection that spans across the width of its window.
How can we create custom styles for Editor GUI components such as IntField, FloatField, Popup etc?
More info:
Say you have an EditorGUILayout.FloatField and a custom GUI.skin.textField. When using Unity's built-in Dark skin along with my custom skin, the custom textField is loaded. However, when using Unity's Light skin, the default textField is loaded.
What is the correct method of skinning Editor GUI controls?
Answer by absameen · Jun 27, 2012 at 05:54 PM
The solution is to use EditorGUIUtility.LookLikeControls() and directly manipulating the styles in EditorStyles.
Answer by sebstar · Jun 27, 2012 at 03:46 PM
My preferred method is to customize an existing type.
you can watch all existing types with the following code in a custom EditorWindow:
foreach(GUIStyle style in GUI.skin.customStyles)
{
GUILayout.Button(style.name,style);
}
If you have the name of the style you can create your starting style for customization like this:
GUIStyle style = "OL Title";
Hmm, to be more specific, I'm talking about customizing the style of Editor components. For example, objectField cannot receive a style. How can we customize it?
Your answer
Follow this Question
Related Questions
Can you apply a GUISkin to an Editor GUI? 1 Answer
Initialising List array for use in a custom Editor 1 Answer
GUISkin & Scripting 2 Answers
GUISkin Problem 1 Answer
GUIskin use image not ninepatch 0 Answers