logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class 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.

    Inheritance
    object
    SerenityRecipeImportContext
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.ProjectRecipe.Infrastructure.Editor
    Assembly: Serenity.UnityProjectRecipe.Infrastructure.Editor.dll
    Syntax
    public sealed class SerenityRecipeImportContext

    Constructors

    SerenityRecipeImportContext(SerenityRecipe, SerenityRecipeReport, SerenityRecipeAssetDatabase, SerenityRecipeReferenceResolver, string, RecipeImportOptionsDto, bool)

    Creates the import context.

    Declaration
    public SerenityRecipeImportContext(SerenityRecipe recipe, SerenityRecipeReport report, SerenityRecipeAssetDatabase assets, SerenityRecipeReferenceResolver resolver, string outputRoot, RecipeImportOptionsDto options, bool dryRun)
    Parameters
    Type Name Description
    SerenityRecipe recipe
    SerenityRecipeReport report
    SerenityRecipeAssetDatabase assets
    SerenityRecipeReferenceResolver resolver
    string outputRoot
    RecipeImportOptionsDto options
    bool dryRun

    Properties

    Assets

    Declaration
    public SerenityRecipeAssetDatabase Assets { get; }
    Property Value
    Type Description
    SerenityRecipeAssetDatabase

    The asset database wrapper (honours DryRun).

    DryRun

    Declaration
    public bool DryRun { get; }
    Property Value
    Type Description
    bool

    When true, no assets are written; only outcomes are resolved and reported.

    Options

    Declaration
    public RecipeImportOptionsDto Options { get; }
    Property Value
    Type Description
    RecipeImportOptionsDto

    Resolved import options; never null.

    OutputRoot

    Declaration
    public string OutputRoot { get; }
    Property Value
    Type Description
    string

    The normalised, validated output root (under Assets/).

    Recipe

    Declaration
    public SerenityRecipe Recipe { get; }
    Property Value
    Type Description
    SerenityRecipe

    The parsed recipe being imported.

    Report

    Declaration
    public SerenityRecipeReport Report { get; }
    Property Value
    Type Description
    SerenityRecipeReport

    The accumulating report shared by all sections.

    Resolver

    Declaration
    public SerenityRecipeReferenceResolver Resolver { get; }
    Property Value
    Type Description
    SerenityRecipeReferenceResolver

    The id-to-asset reference resolver.

    ShouldRegisterAddressables

    Declaration
    public bool ShouldRegisterAddressables { get; }
    Property Value
    Type Description
    bool

    True when this run should register created/resolved assets as Addressable: the recipe requested it and this is not a dry run (a dry run must never touch Addressables settings).

    Methods

    TryResolveAssetPath(string, out string, out string)

    Resolves a recipe's relative output path to a full project path under the output root, validating that it is a safe relative path, that it stays under the root, and that it targets a .asset file.

    Declaration
    public bool TryResolveAssetPath(string relativeOutput, out string fullPath, out string error)
    Parameters
    Type Name Description
    string relativeOutput

    The recipe's relative output path.

    string fullPath

    The resolved project path, when valid.

    string error

    A human-readable reason, when invalid.

    Returns
    Type Description
    bool

    True when the path resolved to a safe asset path under the output root.

    In this article
    © 2026 Serenity. All Rights Reserved