UnityThemeAdapter
Service: Theme (Theme)
Code: Runtime/GnosisEngine/Adapters/Unity/Theme/UnityThemeAdapter.cs
Applies flattened theme values from GnosisThemeService / Persistent to Unity components. The service copies theme JSON onto Persistent when the theme id changes; this adapter polls the current id in Update and reapplies when it changes.
Inspector bindings
Serialized lists map a theme key (same string paths as on Persistent, e.g. color paths) to:
ImagecolorsTextMeshProUGUIcolorsSpriteRenderer/MeshRenderer(material color)Graphic(base class) colors
Supports alpha-only updates when the theme entry is alpha-only (see source: TryResolveThemeColor).
Public helpers
CurrentThemeId— Reads from the boundGnosisThemeService.SetThemeId(string)— CallsSetThemeIdon the service, thenApplyThemeFromData.ForceRefresh()— Re-reads theme and reapplies bindings.
Editor
UnityThemeAdapterEditor (Editor/GnosisEngine/Permanent/Services/Theme/) — Inspector helpers for binding lists.
See also
- Theme service —
SetCurrentTheme,FACT_THEME_CHANGED, JSON shape
Last updated on