Your First Themed Window¶
A complete, working EditorWindow using SKINT. Copy it into Assets/Editor/MyToolWindow.cs and open it from Window ▸ My Tool.
using RevGaming.Skint;
using UnityEditor;
using UnityEngine;
public class MyToolWindow : EditorWindow
{
[MenuItem("Window/My Tool")]
private static void Open() => GetWindow<MyToolWindow>("My Tool");
private bool _enabled = true;
private float _strength = 0.5f;
private string _name = "untitled";
private Color _tint = Color.white;
private void OnGUI()
{
EditorGUILayout.BeginVertical(StyleCache.OuterPanelStyle);
StyleDrawer.DrawPanelHeader("Settings", "Everything below is themed.");
CustomGUIElements.ThemedToggle("Enabled", ref _enabled, "Turn the feature on.");
CustomGUIElements.ThemedSlider("Strength", ref _strength, 0f, 1f);
CustomGUIElements.ThemedTextField("Name", ref _name);
CustomGUIElements.ThemedColorField("Tint", ref _tint);
CustomGUIElements.DrawSeparator();
ThemedProgressBar.Draw(_strength, "Progress");
EditorGUILayout.EndVertical();
}
}
Open the Theme Designer alongside it and change a colour. Your window updates live.
What each piece is doing¶
using RevGaming.Skint; — everything is in one namespace. There is no initialisation step and nothing to register.
StyleCache.OuterPanelStyle — a cached, theme-aware GUIStyle. Reading it is cheap; it is built once and rebuilt only when the theme or editor skin changes. Pass it to any EditorGUILayout call that takes a style.
StyleDrawer.DrawPanelHeader(...) — a themed header with an optional description underneath.
ThemedToggle / ThemedSlider / … — the widget set. Each takes a label and a ref to your value, so it reads like EditorGUILayout with theming applied. All of them accept optional tooltip and isDisabled arguments.
ThemedProgressBar.Draw(...) — takes a 0–1 progress value and a label.
The pattern to copy¶
Wrap a window in a panel style, use DrawPanelHeader to title a section, and reach for DrawStyled or DrawGroup when a section needs a box of its own:
StyleDrawer.DrawStyled("Advanced", () =>
{
CustomGUIElements.ThemedIntSlider("Iterations", ref _iterations, 1, 64);
CustomGUIElements.ThemedToggle("Verbose", ref _verbose);
});
Judge a theme before you write against it
Window ▸ Skint ▸ Widget Gallery renders every themed control under the live theme. It is quicker to check a theme there than to build a window and discover the disabled text is unreadable.
Next¶
- The Two Windows — what the designer and gallery are for
- Themed Widgets — the full control reference