Class ScyllaUITextGroup
Synchronizes the rendered font size across a set of ScyllaUIText siblings. Each member is allowed to compute its own TMP auto-size; the group then reads the resulting sizes, takes the minimum, and broadcasts it back so every member renders at a uniform point size. Useful for groups of button labels whose strings vary in length.
Inherited Members
Namespace: Scylla.Core.Util.UI
Assembly: ScyllaCore.dll
Syntax
[AddComponentMenu("Scylla/UI/Layout/Text Group")]
[DisallowMultipleComponent]
[ExecuteAlways]
public sealed class ScyllaUITextGroup : MonoBehaviour
Remarks
By default the group manages every ScyllaUIText in its descendant hierarchy. Call RefreshMembers() to re-snapshot after hierarchy changes. To manage an explicit set, populate Members from code or override the discovery via the inspector.
Synchronization runs in LateUpdate so TMP has already resolved its
per-member auto-size by the time the group reads fontSize. The
resulting size is pushed via OverrideFontSize(float),
which disables auto-size on the members to prevent TMP from re-fitting.
Properties
AutoDiscover
When true, the group auto-discovers members from descendants.
Declaration
public bool AutoDiscover { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
EffectiveMembers
Returns the snapshot of members that Sync() currently operates on. This is the explicit Members list when populated; otherwise the auto-discovered descendants.
Declaration
public IReadOnlyList<ScyllaUIText> EffectiveMembers { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<ScyllaUIText> |
Members
Explicit member list. Modify directly to manage a hand-picked set; mark dirty via RefreshMembers() after structural changes.
Declaration
public List<ScyllaUIText> Members { get; }
Property Value
| Type | Description |
|---|---|
| List<ScyllaUIText> |
SyncInLateUpdate
When true, the group synchronizes once per frame in LateUpdate.
Declaration
public bool SyncInLateUpdate { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
RefreshMembers()
Re-discovers members in the descendant hierarchy. Called automatically when the auto-discovery flag flips; call manually after structural changes.
Declaration
public void RefreshMembers()
Sync()
Synchronizes the font sizes of all effective members. In play mode each auto-size member is first re-fitted to its current box, then the minimum resulting size is read and pushed back to every member via OverrideFontSize(float) so the group renders at a uniform size that stays responsive to container resizes.
Declaration
public float Sync()
Returns
| Type | Description |
|---|---|
| float | The synchronized font size, or |