logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.Hub.Infrastructure.Editor.Services

    Classes

    EditorIconContentResolver

    Resolves a single built-in editor icon by key, shielding every caller from the two ways a lookup can fail: a blank key (skipped before it reaches the editor API) and an unusable result (a thrown exception from the underlying lookup, or a UnityEngine.GUIContent with no image). Shared by SerenityHubIcons and SerenityHubFavoriteIcons so their fallback chains stay declarative — this is the one place that decides whether a key resolved to something usable.

    SerenityHubEditorPrefsStore

    ISerenityHubKeyValueStore backed by UnityEditor.EditorPrefs — personal, per-user state that persists across sessions. Used for recents (ADR-8) and favorites (ADR-8), consistent with the existing SerenityHubWindow.PREFS_KEY_DONT_AUTO_OPEN mechanism (a plain Serenity.Hub.* key, no per-project scoping — UnityEditor.EditorPrefs is per-user by design, matching the rest of the Hub).

    SerenityHubFavoriteIcons

    Resolves the star icon a SerenityHubToolCard's favorite toggle renders, with the same deterministic, never-throwing fallback chain SerenityHubIcons uses for catalog entries (UX feedback batch 9, fix 3): a primary built-in icon key, then an alternate key for skins/versions where the primary is unavailable, then a blank UnityEngine.GUIContent as the last resort so the toggle itself is still functional even if no built-in star icon resolves.

    SerenityHubFavorites

    User-toggled set of favorite catalog entries, keyed by SerenityHubToolEntry.Id and stored under SerenityHubEditorPrefsStore (ADR-8). Unbounded — unlike recents, no eviction is applied.

    SerenityHubIcons

    Resolves a catalog entry's icon with a deterministic, never-throwing fallback chain (spec §10, ADR-8): the entry's own IconKey → a per-SerenityHubCategory default → a generic fallback icon. A missing or misspelled icon key never blocks the rest of a card (title, description, launch action).

    SerenityHubLauncher

    Launches a real Tools/Serenity/... tool exactly the way a direct menu click would (UnityEditor.EditorApplication.ExecuteMenuItem(System.String)) and records it as a Hub-originated recent. This is the single choke point every catalog card, search result, and Home recent/favorite click launches through, so that "recents record only Hub-originated launches" (spec §8) holds without instrumenting individual tools. A recent is only ever recorded for a launch UnityEditor.EditorApplication.ExecuteMenuItem(System.String) itself reports as having found and executed — a stale MenuPath that resolves to nothing must not be remembered as if the tool had opened.

    SerenityHubRecents

    LRU list (max 8) of the most recent tools launched from within the Hub, stored under SerenityHubEditorPrefsStore (ADR-8). Records the launched tool's MenuPath — the only handle SerenityHubLauncher has at launch time — most-recent-first, deduping an already-recent path to the front instead of adding a duplicate. Per spec §8, this MUST only ever be written by Launch(string), never by instrumenting individual tool windows.

    SerenityHubSessionStateStore

    ISerenityHubKeyValueStore backed by UnityEditor.SessionState — survives domain reloads within an editor session, resets on editor restart. Used for the validation result cache (ADR-7), where freshness must not persist across restarts.

    SerenityHubValidationCache

    Per-validator-kind cache of the last Serenity.Global.Infrastructure.Editor.Validation.SerenityValidationReport run from the Hub, backed by SerenityHubSessionStateStore (ADR-7). Never runs a validator itself — Home and the Validate view read whatever is cached and render a "not yet run" state when nothing has been written for that kind this session.

    SerenityHubValidationSummary

    Immutable snapshot of a cached validator run — result counts, which validators ran, and when — read without triggering a fresh run. Produced by TryReadSummary(string, out SerenityHubValidationSummary).

    Interfaces

    ISerenityHubKeyValueStore

    Minimal string key/value persistence boundary the Hub's session- and preference-backed services depend on. Isolates UnityEditor.SessionState / UnityEditor.EditorPrefs access behind an explicit, constructor-injected dependency so cache freshness, eviction, and serialization logic can be tested against a fake instead of real editor-global state.

    In this article
    © 2026 Serenity. All Rights Reserved