logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.ProjectRecipe.Infrastructure.Editor.Importers

    Classes

    AchievementRecipeImporter

    Creates or updates UnityAchievementDefinition assets from the achievements section. The polymorphic [SerializeReference] Condition tree round-trips via RecipeSerializedPropertyCodec, and generateTrigger writes the companion UnityEventDispatcherSignalDefinition that dispatches UnlockAchievementSignal for this achievement's id.

    AudioClipRecipeImporter

    Generates UnityAudioPlayerClipDefinition assets from the audioClips section. Fully supported: every field maps directly to a public field on the definition.

    CutsceneRecipeImporter

    Generates UnityCutsceneDefinition assets from the cutscenes section. Each stage's type, duration, fade colour, Timeline reference and dialog fields are written through a UnityEditor.SerializedObject (the UnityCutsceneStep fields are private), and the optional rig prefab is resolved by path. Runs between menus (30) and modals (40) so a cutscene exists before anything references it. A cutscene holding a stage the player does not play (CutsceneStageTypePlayback) is refused; a dialog stage with nothing to show, or too short to read, is only warned about (CutsceneDialogStageRules).

    FeedbackRecipeImporter

    Creates or updates FeedbackDefinition assets from the feedbacks section. The polymorphic [SerializeReference] Effects list round-trips via RecipeSerializedPropertyCodec — no bespoke per-effect DTO is needed. When generateTrigger is true, a companion UnityEventDispatcherSignalDefinition pre-wired to dispatch PlayFeedbackSignal for this feedback id is also created (idempotently) at the same path with a Trigger suffix.

    GenericAssetRecipeImporter

    Creates or updates arbitrary Serenity ScriptableObjects from the generic assets section, applying their captured field tree via RecipeSerializedPropertyCodec. Covers composite views, UI themes, action definitions, and every settings/config asset — including their [SerializeReference] signal graphs. Runs after the typed sections so references to generated menus/modals resolve by path.

    MenuRecipeImporter

    Generates UnityMenuSettingsDefinition assets from the menus section. Layout, title, alignment, direction, scrolling, options, and signal wiring (menu-level onShow/onHide/ onCancel/onSubmit and per-option submit signals) are supported. Signals are applied through RecipeSignalCodec; an unresolvable signal type is reported and left unset.

    ModalRecipeImporter

    Generates UnityModalSettings assets from the modals section. Content (title/text), alignment, direction, scrolling, and options are supported and written through the modal's public parameter properties; each option's submit signals are wired via RecipeSignalCodec. The optional signalTypeName (the signal the modal listens for) is passed through verbatim; a non-empty value that cannot be resolved is reported as a warning (the modal is still created).

    MusicTrackRecipeImporter

    Generates UnityMusicTrackDefinition assets from the musicTracks section. Fully supported: time/bar loop fields map directly. A Custom fade curve falls back to the asset default, since custom animation curves cannot be expressed in a recipe.

    RecipeDuplicateIdentityValidation

    Refuses a view whose options — or whose options' submit signals — cannot be told apart. A recipe matches both by Guid, so two options of one view, or two signals of one option, sharing a Guid leave it guessing: a guess edits the wrong one, or appends one more on every import. A Guid shared on the asset the recipe would update, or in the recipe itself, is reported as an error naming the asset and the Guid, and nothing is written to that view until each carries a Guid of its own. A recipe entry the merge refused — for claiming a Guid another option or signal already owns, or for naming by its Id (an option) or its position and type (a signal) an element that carries a different Guid (RecipeIdentityConflict) — is described here too, so every identity conflict reads the same way in the report (RecipeUiOptionMerger, RecipeSignalListMerger).

    RecipeIdentityConflict

    A recipe entry an identity merge left out because its own Guid matches nothing, yet its fallback key — an option's Id, a submit signal's position and type — names an existing element that carries a different Guid no recipe entry claims. The entry is not that element, and appending it beside it would give the list two elements of one name, so it is reported instead of written.

    RecipeIdentityRefusals

    The recipe entries an identity merge left out rather than write: an entry claiming a Guid another element of the list already owns, and an entry whose fallback key names an element of another identity (RecipeIdentityConflict). DescribeRefusals(string, RecipeIdentityRefusals, RecipeIdentityRefusals) turns them into the run's warnings.

    RecipeListOrder

    The order rule every identity merge of a recipe list shares (a view's options, an option's submit signals): a recipe that lists every element of the list states the list's order, so that order is applied; a recipe that lists only some elements says nothing about where the others belong, so the list keeps its own order.

    RecipeSectionImporterBase

    Shared base for section importers. Centralises enum parsing and the idempotent create-or-update ("upsert") of a UnityEngine.ScriptableObject that carries Serenity's IFoundationSettings identity, so concrete importers only describe how to populate their fields.

    RecipeSignalListMerger

    Meets a recipe option's submit signals with the signals the option already owns, by identity rather than by position: a recipe signal is matched to an existing one by its Guid, or — when either side has none — to the existing signal at the same position when it has the same type. A matched signal is edited in place, an existing signal the recipe leaves out is left untouched, a recipe signal with no match is appended into a slot of its own, and the list takes the recipe's order only when the recipe lists every signal (RecipeListOrder). Every signal the recipe writes leaves with a Guid, so a blank one is filled on its first write. A recipe signal is refused instead of written when it would give a signal a Guid another signal of the option already owns, or when its Guid matches nothing while the signal of the same type at its position carries a Guid of its own no recipe signal claims (RecipeIdentityConflict) — never appended beside it.

    RecipeTriggerSignalDefinitionWriter

    Writes the companion "trigger" UnityEventDispatcherSignalDefinition that a typed section generates when an entry asks for one (generateTrigger): the asset a SignalEmitterComponent fires to drive that entry with no generated code.

    RecipeUiOptionFactory

    Builds and validates UiOptions from recipe option DTOs. Produces the flat fields (id, label, value/interaction type, a simple string default, translation flags); the option's submit signals are wired separately through ApplyOptionSignals(SerializedProperty, RecipeUiOptionDto[], IReadOnlyList<int>, List<string>) (they need the serialized property).

    RecipeUiOptionMerge

    The options a view ends up with after a recipe met the options it already owned, where each recipe option landed — the index its submit signals must be written to — and the recipe options it refused.

    RecipeUiOptionMerger

    Meets a recipe's options with the options a menu or modal already owns, by identity rather than by position: a recipe option is matched to an existing one by its Guid, or by its Id when either side has no Guid. A matched option is edited in place — its binding, Guid and view id kept unless the recipe describes them — an existing option the recipe leaves out is left untouched, and a recipe option with no match is appended. No option is ever blanked because the lists are not the same length. A recipe that lists every option puts them in its order; one that lists only some keeps the view's order (RecipeListOrder). Every option the merge writes leaves with a Guid, so a blank one is filled on its first write. A recipe option is refused instead of written when it would give an option a Guid another option of the view already owns, or when its Guid matches nothing while its Id names an option that carries a Guid of its own no recipe option claims (RecipeIdentityConflict) — never appended as a second option of that Id.

    Interfaces

    ISerenityRecipeSectionImporter

    A handler responsible for one recipe section. Section importers validate their own data, resolve references, and create or update the assets for that section. New sections are added by implementing this interface and registering the importer with the engine — no existing importer changes.

    In this article
    © 2026 Serenity. All Rights Reserved