Editor¶
Purpose¶
The two windows SKINT puts on the Window menu, and nothing else. These are shells: they own placement, lifecycle and menu registration, and delegate every pixel to the UI and Styling territories.
Owns¶
SkintThemeDesignerWindow—Window ▸ Skint ▸ Theme DesignerSkintWidgetGalleryWindow—Window ▸ Skint ▸ Widget Gallery- Menu priorities, window titles and minimum sizes
- Caching the preset list so it is not re-enumerated per frame
Does NOT Own¶
- Drawing the theme fields —
StyleDrawer.DrawThemeSelectordoes that - Drawing preset management —
ThemedPresetBlockdoes that - Theme reading or writing
Allowed Dependencies¶
Editor may depend on:
UnityEditor,EditorWindow- UI, Styling and Core
Nothing may depend on Editor. It is the top of the stack.
Notes¶
The two windows were one. A single SkintTestWindow held both the real tool and a widget demonstration, under a menu path that said "Test Window" — which is the wrong name for the thing a customer is meant to use every day. Splitting them means the Theme Designer is unambiguously the product and the Widget Gallery is unambiguously a demonstration. Each has a toolbar button opening the other.
OnGUI wraps the selector in a try/catch that rethrows ExitGUIException and logs anything else. Letting an exception escape OnGUI leaves IMGUI's layout stack unbalanced, so the window breaks in a way that outlives the original error and is much harder to diagnose.
The preset list is cached and refreshed on a dirty flag. Enumerating the presets directory per frame meant three Directory.Exists calls, a Directory.GetFiles and a LINQ projection on every repaint, which is exactly the cost the style cache exists to avoid.
Future Candidates¶
- The Widget Gallery is a flat list. If the widget set grows, grouping it to mirror the designer's sections would make comparison easier.