logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

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

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

    Methods

    AuthorableTypes()

    All authorable Serenity ScriptableObjects (non-abstract, Serenity.* namespace, with a [CreateAssetMenu]), sorted by full name.

    Declaration
    public static IReadOnlyList<Type> AuthorableTypes()
    Returns
    Type Description
    IReadOnlyList<Type>

    The authorable types.

    GenerateAll(List<string>)

    Generates one recipe containing a stub for every authorable type (a full reference recipe).

    Declaration
    public static string GenerateAll(List<string> warnings = null)
    Parameters
    Type Name Description
    List<string> warnings

    Optional sink for codec warnings.

    Returns
    Type Description
    string

    The recipe JSON.

    GenerateFromCommandLine()

    Headless entry: -recipeType <FullTypeName|all> and -recipeOutput <path>. Mirrors ExportFromCommandLine(); usable from an MCP server / CI.

    Declaration
    public static void GenerateFromCommandLine()

    GenerateStub(Type, List<string>)

    Generates a one-asset recipe stub (pretty JSON) for the given ScriptableObject type.

    Declaration
    public static string GenerateStub(Type soType, List<string> warnings = null)
    Parameters
    Type Name Description
    Type soType

    The type to template.

    List<string> warnings

    Optional sink for codec warnings (unsupported property types, etc.).

    Returns
    Type Description
    string

    The recipe JSON.

    IsTypedSection(Type)

    Returns true when the type is authored through a dedicated typed section (not assets).

    Declaration
    public static bool IsTypedSection(Type soType)
    Parameters
    Type Name Description
    Type soType

    The ScriptableObject type.

    Returns
    Type Description
    bool

    True for the four typed section types.

    SectionName(Type)

    The recipe section a type is authored through.

    Declaration
    public static string SectionName(Type soType)
    Parameters
    Type Name Description
    Type soType

    The ScriptableObject type.

    Returns
    Type Description
    string

    audioClips / musicTracks / menus / modals for the typed sections, otherwise assets (the generic section).

    In this article
    © 2026 Serenity. All Rights Reserved