logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SequencePlayerCreator

    Generates (or updates) a SequencePlayer aggregate asset chain: an ordered list of UnitySequenceDefinition assets under <OutputFolderPath>/Sequences/ and one UnitySequencePlayerSettings directly under OutputFolderPath referencing them, in the exact order they were authored. Mirrors Serenity.Wave.Editor.Builder.WaveCreator's multi-asset shape (bottom-up resolve-or-create, then the referencing asset, full rollback on any failure) — sequence definitions are the "leaves", the settings asset is the "root" that references them, exactly like wave configs feeding a wave set.

    SequencePlayer is the only aggregate with no installer. Verified by reading UnitySequencePlayerService: it is a plain scene MonoBehaviour that resolves its own definitions on Awake() in three tiers — (1) an inspector-assigned array, (2) a label-loaded UnitySequencePlayerSettings tagged SEQUENCE_PLAYER, (3) loose label-loaded UnitySequenceDefinition assets carrying the same label — nothing in the composition root ever creates or configures this MonoBehaviour. Creating these assets and tagging them correctly is necessary but not sufficient: a UnitySequencePlayerService must also exist in a loaded scene, or the assets created here are never read by anything. Create(Input)'s result always carries a warning to this effect (SceneServicePlacementWarningMessage) — a wizard window collecting input, rendering results, and offering an explicit "place service in scene" action ships alongside this engine; every asset mutation lives here only.

    Both tiers carry the label. Verified against UnitySequencePlayerService.EnsureDefinitionsLoaded: it first looks for a labelled UnitySequencePlayerSettings and uses its Definitions if any exist; only when no labelled settings asset carries definitions does it fall back to loose labelled UnitySequenceDefinition assets. Since this engine always creates a settings asset referencing every authored definition, the fallback tier never actually triggers for wizard-authored content — but the definitions are retagged SEQUENCE_PLAYER regardless, so they still resolve correctly if a settings asset is later deleted or a definition is reused loose elsewhere.

    Stage Ids are never a resolution key. Verified by reading ExecuteStageAsync(ISequenceStage, CancellationToken) and PlayDefinitionAsync: stages are iterated strictly by list position; a stage's Id is only ever used for a verbose log line. Unlike a definition/settings Id collision (a genuine same-asset data-loss bug), a duplicate or blank stage Id within one definition is cosmetic — Validate(Input) only ever warns about it, never blocks.

    A wizard window collecting input and rendering results ships in a separate file (CreateSequencePlayerWindow); every asset mutation lives here.

    Inheritance
    object
    SequencePlayerCreator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.SequencePlayer.Infrastructure.Editor.Builder
    Assembly: Serenity.UnitySequencePlayer.Infrastructure.Editor.dll
    Syntax
    public static class SequencePlayerCreator

    Fields

    SceneServicePlacementWarningMessage

    The exact prose Create(Input) always adds to Result.Warnings alongside setting NeedsSceneServicePlacement — a single shared literal so a caller matching on the message compares against this constant instead of sniffing a substring. Public: read by CreateSequencePlayerWindow (same assembly) and asserted on directly by SequencePlayerCreatorTests (a separate test assembly).

    Declaration
    public const string SceneServicePlacementWarningMessage = "These assets do nothing by themselves — SequencePlayer has no installer. A UnitySequencePlayerService MonoBehaviour must exist in a loaded scene (inspector-assigned array, or auto-discovered via the module:sequence-player label) before any sequence can play. Add one manually, or use this wizard's Done step \"Place service in open scene\" button."
    Field Value
    Type Description
    string

    Methods

    Create(Input)

    Validates the request, then resolves-or-creates every sequence definition bottom-up (in Definitions order) and finally the settings asset referencing them in that same order. On any failure every mutation across every touched asset is rolled back: created assets/folders are deleted (with Serenity.Global.Infrastructure.Editor.Validation.References.SerenitySafeDeleteScope suppressed — the settings asset holds live, not-yet-saved references to definitions this same call may have just created, which would otherwise trip SerenitySafeDeleteAssetProcessor's referencer scan and silently abort the delete), their Addressables entries removed, and any already-existing asset that was being edited has its pre-call field values restored.

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

    Preview(Input)

    Computes what Create(Input) would do without mutating the project.

    Declaration
    public static SequencePlayerCreator.PreviewResult Preview(SequencePlayerCreator.Input input)
    Parameters
    Type Name Description
    SequencePlayerCreator.Input input
    Returns
    Type Description
    SequencePlayerCreator.PreviewResult

    Validate(Input)

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