Back to API Reference
Class
StylePreset
Shareable, project-asset container of Style entries that components apply in bulk via AddStylePreset or via GlobalStylePreset.
Remarks
Mutating the preset at runtime through
AddStyle / RemoveStyle / ClearStyles raises Changed; every UniTextBase that has this preset attached (locally or as the global preset) discards its runtime preset copies and re-instantiates from the new contents on the next frame.public IReadOnlyList<Style> Styles{ get }Snapshot view of the contained styles. Mutate via AddStyle / RemoveStyle / ClearStyles so subscribers are notified.
public Action ChangedRaised whenever the preset's styles list is mutated — either through the editor inspector (OnValidate) or programmatically via AddStyle / RemoveStyle / ClearStyles. Subscribers are expected to be idempotent (the event may fire several times in a row on rapid edits).
