Class ScyllaUILayoutDebugDraw
Debug overlay for the Scylla UI Layout components. Walks the ScyllaUILayoutRoot's descendant hierarchy and draws a thin outline around every layout container and every wrapped child, using a distinct color per component type so designers can visually trace the layout structure.
Inherited Members
Namespace: Scylla.Core.Util.UI
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/UI/Layout/Layout Debug Draw")]
[DisallowMultipleComponent]
[RequireComponent(typeof(RectTransform))]
[DefaultExecutionOrder(100)]
[ExecuteAlways]
public sealed class ScyllaUILayoutDebugDraw : MonoBehaviour
Remarks
Outlines are rendered as canvas UI geometry through an internal
Scylla.Core.Util.UI.ScyllaUILayoutDebugOverlay graphic that the component creates and
keeps as the top-most sibling. Because the outlines live inside the canvas, they
are pixel-accurate in the Game view and the Scene view alike, in every canvas
render mode (Overlay, Camera, World Space), and they update live in edit mode as
well as play mode (no DontDestroyOnLoad dependency).
Outlines stack additively when a single RectTransform hosts multiple Scylla components - for example a child stack that is also wrapped by a ScyllaUIFlexElement draws both a container outline and a wrapper outline at the same rect.
The component uses UnityEngine.DefaultExecutionOrder 100 to run after the ScyllaUILayoutRoot's solve flush in the same frame, so outlines track the latest solved layout.
Properties
Config
Per-component-type color palette and line thickness.
Declaration
public ScyllaUILayoutDebugDrawConfig Config { get; set; }
Property Value
| Type | Description |
|---|---|
| ScyllaUILayoutDebugDrawConfig |
Enabled
Master on / off. When false the overlay is cleared and the component does
no work each frame; toggle to true to start drawing outlines.
Declaration
public bool Enabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Draw()
Immediately walks the descendant hierarchy and rebuilds the outline overlay.
Normally invoked automatically from LateUpdate when Enabled
is true; exposed publicly so callers can drive the overlay manually.
Declaration
public void Draw()