logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.ProjectRecipe.Infrastructure.Editor

    Classes

    RecipeAssetChange

    What a recipe did (or would do) to one asset that already existed: nothing, only a blank identity filled in (the asset's own, or that of an option or a signal it holds), or real field changes — and which fields. The difference between the three is what an author needs to read in the report, so it is decided once here from two snapshots rather than by each importer.

    RecipeExistingAssetUpdater

    Applies a recipe entry to an asset that already exists and says what that changed. An import mutates the asset itself and marks it dirty only when its serialized data really changed, so an unedited entry writes nothing; a dry run applies the very same mutation to a throwaway copy, so the plan it reports is the change the import would make.

    RecipeObjectReferenceCodec

    Encodes an object reference as the text a recipe carries, and resolves that text back to the object: a main asset is its bare asset path, a sub-asset (a mixer group, a sprite in a sheet) is its asset path and local file id joined by SubAssetSeparator. The object-reference half of RecipeSerializedPropertyCodec.

    RecipeRetiredSectionReporter

    Warns about every retired section (RecipeRetiredSections) a recipe still carries, naming the section, its item count and where its assets belong now.

    RecipeSerializedPropertyCodec

    Converts a ScriptableObject's UnityEditor.SerializedProperty tree to and from RecipeNodes. Handles primitives, enums, vectors/colors/rects, object references (encoded as asset paths), arrays/lists, nested structs, and polymorphic [SerializeReference] managed references (e.g. signals); object references travel through RecipeObjectReferenceCodec. This is the engine behind the generic assets section and the signal-wiring capture on menus/modals. A field marked RecipeIgnoredAttribute is skipped silently in both directions.

    RecipeSerializedSnapshot

    Every serialized leaf value of one object, keyed by its property path, taken at one moment. Two snapshots of the same object — before and after a recipe touched it — say exactly which fields changed, so a run reports "unchanged" only when the serialized data really is the same and writes nothing in that case.

    RecipeSignalCodec

    Bridges recipe RecipeSignalDtos and the [SerializeReference] signal slots on menus, modals, and options, reusing RecipeSerializedPropertyCodec so a signal (parameterless marker or one carrying serialized data) is wired and captured exactly like a generic asset's managed reference. This is the implementation of "typed menu/modal signal wiring" (recipe automation Gap 4). A signal's own Guid travels as guid, never among its fields, so an import can match on it.

    RecipeSignalValidation

    Validation helpers for signal DTOs, used by the menu/modal importers' report passes.

    SerenityDiscoveryRegistry

    Emits a machine-readable "what exists" registry so an AI agent can look up the facts it needs to author a valid recipe instead of guessing them: every concrete event signal, every authored action id (the targets of a menu/modal ACTION option), the recipe enum vocabularies, the authorable ScriptableObject types and their recipe section, and the semantic ID contracts. The output is the discovery counterpart to SerenityRecipeReport.ToJson; resolution is decoupled (types are looked up by name) so this editor assembly takes no extra references.

    SerenityProjectRecipeExporterWindow

    Editor window for the Serenity Project Recipe exporter. Scans a project folder for supported Serenity ScriptableObjects and writes a .serenity-recipe.json describing them, which can then be edited and re-imported with the importer window.

    SerenityProjectRecipeImporterWindow

    Editor window for the Serenity Project Recipe importer. Lets a user pick a .serenity-recipe.json file, optionally override the output root, and run validation, a dry run, or a real import — each rendering the resulting report and mirroring it to the console. What the buttons do lives in SerenityRecipeImportFlow; an import is confirmed in the window against the plan it shows.

    SerenityRecipeAssetDatabase

    Thin wrapper over Unity's UnityEditor.AssetDatabase that centralises folder creation, existence/type probing, asset creation, dirtying, and saving for the importer. Write operations are suppressed when DryRun is true, so callers can share one code path for validation, dry runs, and imports.

    SerenityRecipeEngine

    Orchestrates a recipe run: resolves the output root, builds the shared context, runs cross-section and per-section validation, and (unless blocked or validate-only) drives each section importer. The importer registry is built here, so adding a new section means adding one importer to CreateImporters().

    SerenityRecipeExporter

    Builds a SerenityRecipe from the Serenity ScriptableObjects already in the project and writes it as .serenity-recipe.json. The reverse of SerenityRecipeEngine: scan → map → serialize. The scanned folder becomes the recipe's outputRoot, so an exported recipe re-imports the same assets in place.

    SerenityRecipeImportContext

    Everything a section importer needs for a single run: the parsed recipe, the shared report, the asset database wrapper, the reference resolver, the resolved output root, the import options, and whether this is a dry run. Both validation and import read from the same context, so the requested "validation context" and "import context" are unified here.

    SerenityRecipeImportFlow

    What the Project Recipe importer window does when its buttons are pressed: validate, dry-run, or import the chosen recipe file, keeping the last report for the window to draw. An import is never run straight from its button: the button resolves the plan and stages it behind an in-window confirmation that shows the plan's counts and the assets it writes, and the confirmation runs the import only if the plan is still the one that was shown.

    SerenityRecipeLoader

    Reads a .serenity-recipe.json file from disk and parses it into a SerenityRecipe using Unity's UnityEngine.JsonUtility. All failure modes are reported as blockers rather than thrown.

    SerenityRecipePathUtility

    Single source of truth for recipe path logic: normalising separators, combining a relative output path with the configured output root, and validating that the result stays under that root. No other type in the importer should build asset paths by hand.

    SerenityRecipeReferenceResolver

    Resolves references during an import. It maps stable recipe ids to the assets they generate (so later sections can wire cross-recipe references by id), and loads existing project assets by path. This is the backbone that lets future section importers reference earlier output without ever touching Unity GUIDs.

    SerenityRecipeTemplateGenerator

    Produces ready-to-edit Project Recipe stubs for any authorable Serenity ScriptableObject. For the four typed sections it emits an example typed entry; for every other type it instantiates the SO and captures its exact serialized field tree with RecipeSerializedPropertyCodec — so the generated assets shape always matches the current code and never drifts. This is the source of truth the per-ScriptableObject cookbooks point at.

    SerenityRecipeTemplateGeneratorWindow

    Editor window for the Recipe Template Generator. Pick any authorable Serenity ScriptableObject and get a ready-to-edit recipe stub with its exact fields — copy it into a .serenity-recipe.json or save it. The exact assets field tree is captured from the live type, so it never drifts from the code.

    Structs

    DiscoveryCounts

    The top-level entity counts BuildJson() would report — see BuildCounts(), the cheap read this backs for Serenity.ProjectRecipe.Infrastructure.Editor.DiscoveryRegistryWindow's scope preview.

    ResolvedRecipeAsset

    A generated asset's resolved location and (when written) its instance.

    Enums

    RecipeAssetPresence

    Whether a target asset already exists and, if so, whether its type matches the expected one.

    RecipeRunMode

    How far a recipe run goes.

    In this article
    © 2026 Serenity. All Rights Reserved