Class ScyllaUILayoutRoot
Scene root for the Scylla UI layout system. Hosts the dirty-batch tick, watches resolution and orientation changes, and drives the solve for every ScyllaUIStackBase in its descendant tree.
Inherited Members
Namespace: Scylla.Core.Util.UI
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/UI/Layout/Layout Root")]
[DisallowMultipleComponent]
[RequireComponent(typeof(RectTransform))]
[ExecuteAlways]
public sealed class ScyllaUILayoutRoot : MonoBehaviour
Remarks
Add one root per screen-space canvas. Stacks register themselves with the
nearest ancestor root on OnEnable; without an ancestor root, individual
stacks fall back to per-stack self-solves in their own LateUpdate.
The root flushes pending dirty stacks once per frame in LateUpdate. On
resolution, orientation, or safe-area changes the root marks all registered
stacks dirty.
Properties
DebugDrawEnabled
Convenience proxy for the runtime debug overlay. Returns true when a
ScyllaUILayoutDebugDraw sibling exists and has its
Enabled flag set. Setting this to
true attaches a debug-draw component if one is not present yet, so
toggling the overlay from code or a button binding takes a single line.
Declaration
public bool DebugDrawEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
RectTransform
Cached RectTransform component reference. Resolved via
GetComponent on first access.
Declaration
public RectTransform RectTransform { get; }
Property Value
| Type | Description |
|---|---|
| RectTransform |
SolveInLateUpdate
When true (the default), the root calls Scylla.Core.Util.UI.ScyllaUILayoutRoot.Flush() once per
frame in LateUpdate to process all pending dirty stacks. Set to
false to take manual control of the flush timing, then call
SolveAllNow() explicitly.
Declaration
public bool SolveInLateUpdate { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
WatchOrientation
When true, the root polls Screen.orientation every frame and
marks all registered stacks dirty on change. Useful for mobile layouts that
reflow between portrait and landscape.
Declaration
public bool WatchOrientation { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
WatchResolution
When true, the root polls Screen.width and Screen.height
every frame and marks all registered stacks dirty when either value changes.
Disable if the canvas never resizes to avoid the per-frame comparison overhead.
Declaration
public bool WatchResolution { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
WatchSafeArea
When true, the root polls Screen.safeArea every frame and marks
all registered stacks dirty when the safe-area rect changes. Relevant for
devices with notches or system overlays that affect the usable screen area.
Declaration
public bool WatchSafeArea { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
SolveAllNow()
Forces an immediate solve of every registered stack regardless of dirty state. Use sparingly: the normal path is to call MarkDirty() and let the next-frame flush handle the solve.
Declaration
public void SolveAllNow()