logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class GameCameraSettingsCreator

    Generates (or updates) the project-wide UnityGameCameraSettings asset from a single description. Mirrors Serenity.GameProgress.Infrastructure.Editor.Builder.GameProgressCreator and Serenity.GameSave.Infrastructure.Editor.Builder.GameSaveCreator: static class, Input/Result DTOs, Validate, Create with created-paths rollback on failure — resolved and folder-provisioned through the shared SettingsAssetAuthoring engine rather than a private copy of its logic.

    Unlike GameProgress/GameSave — which treat more than one project-wide settings asset as a hard error because they enforce a true single-instance identity — a second UnityGameCameraSettings asset does not break the GameCamera installer (it loads every asset tagged module:game-camera and uses the first one found); ambiguity here is surfaced as a warning instead of blocking the run.

    CreateGameCameraSettingsWindow only collects input and renders results; every asset mutation lives here.
    Inheritance
    object
    GameCameraSettingsCreator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.GameCamera.Infrastructure.Editor.Builder
    Assembly: Serenity.UnityGameCamera.Infrastructure.Editor.dll
    Syntax
    public static class GameCameraSettingsCreator

    Fields

    DefaultOutputFolder

    Folder a brand-new settings asset is created under when the caller names none.

    Declaration
    public const string DefaultOutputFolder = "Assets/Game/Media/GameCamera"
    Field Value
    Type Description
    string

    SettingsAssetFileNameFallback

    Fallback file name for the settings asset when Id sanitizes to nothing usable — passed to FileNameSafe(string, string) alongside CreateGameCameraSettingsWindow's own target-section path preview, so both compute the exact same planned file name.

    Declaration
    public const string SettingsAssetFileNameFallback = "GameCameraSettings"
    Field Value
    Type Description
    string

    Methods

    Create(Input)

    Validates the request, then maps it onto a throwaway scratch draft and hands that to CreateFromDraft(UnityGameCameraSettings, string, string, bool) — the single place that ever writes a field onto the real asset. Kept for headless/test callers that only have the flat GameCameraSettingsCreator.Input shape; CreateGameCameraSettingsWindow itself skips this DTO entirely and calls CreateFromDraft(UnityGameCameraSettings, string, string, bool) with its own SerenityWizardDraftLifecycle<UnityGameCameraSettings>-managed draft directly.

    Declaration
    public static GameCameraSettingsCreator.Result Create(GameCameraSettingsCreator.Input input)
    Parameters
    Type Name Description
    GameCameraSettingsCreator.Input input
    Returns
    Type Description
    GameCameraSettingsCreator.Result

    CreateFromDraft(UnityGameCameraSettings, string, string, bool)

    The single write path: resolves-or-creates the settings asset, then commits every field on draft onto it via ResolveAndCommit<TSettings>(TSettings, string, string, string, SerenityAssetCreationTransaction) — serialization decides what gets written, not a hand-maintained field list. This is the same shared call CreateFromDraft(TSettings, string, string, bool) uses for the Ui/Menu/Modal singletons — GameCamera cannot instantiate that engine directly because its own GameCameraSettingsCreator.Input/GameCameraSettingsCreator.Result predate SingletonSettingsInput/ SingletonSettingsResult, so it calls the shared resolve-and-commit step directly instead of keeping a second copy of it. On any failure every mutation is rolled back through the transaction's existing-asset restore.

    Declaration
    public static GameCameraSettingsCreator.Result CreateFromDraft(UnityGameCameraSettings draft, string explicitSettingsAssetPath, string newSettingsFolderPath, bool registerAsAddressables)
    Parameters
    Type Name Description
    UnityGameCameraSettings draft

    Every field to write, already resolved (an already-seeded scratch draft from an existing asset for an update-in-place run, or a freshly populated one for a create). Its own Guid is ignored on purpose — identity is owned by ResolveAndCommit<TSettings>(TSettings, string, string, string, SerenityAssetCreationTransaction).

    string explicitSettingsAssetPath

    Explicit target path (a test seam and an already-known-asset fast path) — see SettingsAssetPath.

    string newSettingsFolderPath

    Folder a brand-new asset is created under when none exists.

    bool registerAsAddressables

    Whether to register a newly created asset as Addressable.

    Returns
    Type Description
    GameCameraSettingsCreator.Result

    ResolveExistingAssetFromPath(Input)

    For a caller that knows only SettingsAssetPath and has no live ExistingAsset reference in hand — a headless tool, a recipe importer — resolves the asset already at that path and states it as the caller's own identity assertion, a no-op when ExistingAsset is already set or nothing exists at the path yet (a genuine create). Serenity.GameCamera.Infrastructure.Editor.Builder.GameCameraSettingsCreator.ResolvedToAnAssetThisCallDoesNotAlreadyKnowAbout(Serenity.GameCamera.Infrastructure.Editor.Builder.GameCameraSettingsCreator.Input,Serenity.StructuredPersistence.Infrastructure.Editor.Authoring.SettingsAssetAuthoring.SettingsResolution{Serenity.GameCamera.Infrastructure.Settings.UnityGameCameraSettings}) stays unconditional either way — this only gives a path-only caller a way to state what it means before reaching it, mirroring CreateGameCameraSettingsWindow's own target resolution, which always sets ExistingAsset from whatever it resolved before calling Validate(Input) or Create(Input). Mutates and returns input for a fluent call site.

    Declaration
    public static GameCameraSettingsCreator.Input ResolveExistingAssetFromPath(GameCameraSettingsCreator.Input input)
    Parameters
    Type Name Description
    GameCameraSettingsCreator.Input input
    Returns
    Type Description
    GameCameraSettingsCreator.Input

    ResolveSettingsContext(string)

    Thin wrapper over the shared ResolveSettingsContext<TSettings>(string, string), exposed so CreateGameCameraSettingsWindow can auto-detect the project-wide singleton for its "Edit existing" field.

    Declaration
    public static SettingsAssetAuthoring.SettingsResolution<UnityGameCameraSettings> ResolveSettingsContext(string explicitSettingsAssetPath = "")
    Parameters
    Type Name Description
    string explicitSettingsAssetPath
    Returns
    Type Description
    SettingsResolution<UnityGameCameraSettings>

    Validate(Input)

    Validates the request: a non-empty Id, and either a resolvable existing asset or a well-formed destination folder for a fresh one. A project-wide search turning up more than one existing asset is surfaced as a warning (see the ambiguity note on the type), never an error.

    Declaration
    public static SerenityCreationValidationResult Validate(GameCameraSettingsCreator.Input input)
    Parameters
    Type Name Description
    GameCameraSettingsCreator.Input input
    Returns
    Type Description
    SerenityCreationValidationResult
    In this article
    © 2026 Serenity. All Rights Reserved