OutlineEditor

Custom Inspector for the Outline component. Renders color and width properties inside a styled DrawGUI.Box with a header label, and live-applies changes to the outline material via Outline.ApplySettings() when values are modified.

Definition

Namespace: Paragon.Townskeep.OutlineSystem.Editor Assembly: Townskeep.Editor.dll

[CustomEditor(typeof(Outline))]
public class OutlineEditor : OdinEditor

Inherits: OdinEditor (Odin Inspector)

Remarks

This editor replaces Unity's default Inspector for the Outline component with a clean, styled layout using Paragon's DrawGUI utility. It draws only the color and width serialized fields, wrapped in a box with an "Outline Settings" header.

The key feature is live preview: an EditorGUI.BeginChangeCheck() / EndChangeCheck() block detects when the user modifies either property, then immediately calls outline.ApplySettings() to push the new values to the shader material. This means color and width changes are visible in the Scene view without needing to enter play mode.

After applying settings, Tree.ApplyChanges() is called to persist the Odin property tree changes to the serialized object.

Quick Lookup

Goal
How

Live preview outline changes

Changes are applied automatically via ApplySettings()

Access the Outline target

(Outline)target

Draw properties via Odin tree

Tree.RootProperty.Children["fieldName"].Draw()

Methods

OnInspectorGUI

Renders the custom Inspector layout:

Inspector Layout

The editor renders:

Property
Widget
Description

color

Color picker with [ColorPalette("Outlines")]

Outline color selection from the "Outlines" palette

width

Slider [Range(0, 10)]

Outline width in pixels

Common Pitfalls

circle-exclamation
circle-exclamation

See Also

  • Outline — the component being edited

  • SmoothNormals — smooth normal baking used by the Outline component

Last updated