Class 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.
Inherited Members
Namespace: Serenity.ProjectRecipe.Infrastructure.Editor.Importers
Assembly: Serenity.UnityProjectRecipe.Infrastructure.Editor.dll
Syntax
public static class RecipeTriggerSignalDefinitionWriter
Remarks
Owns the convention every section must agree on — the <Name>Trigger.asset path beside the
entry's own asset, the load-or-create idempotency, the re-stamping of the id on an existing asset, and the
outcomes reported so the run registers the trigger as Addressable alongside its entry. What the trigger
dispatches stays with the section: each importer passes a builder that wires its own signal, because that
is the one part no two sections share.
Methods
StringParameter(string, string, bool)
Builds a string constructor parameter for a trigger's signal, the only parameter kind a recipe can author (a recipe wires ids, never live object references).
Declaration
public static UnityConfiguredSignalParameter StringParameter(string name, string value, bool includeOptional = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The constructor parameter name. |
| string | value | The value baked into the trigger. |
| bool | includeOptional | Whether the parameter is passed at all; false leaves it at its default. |
Returns
| Type | Description |
|---|---|
| UnityConfiguredSignalParameter | The configured parameter. |
TriggerPathBeside(string)
The trigger asset's path: the entry's own path with Trigger before the extension.
Declaration
public static string TriggerPathBeside(string entryFullPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | entryFullPath | The entry asset's resolved project path. |
Returns
| Type | Description |
|---|---|
| string | The trigger asset's project path. |
Write(SerenityRecipeImportContext, string, string, string, Func<string, UnityEventDispatcherSignalDefinition>, List<string>)
Idempotently creates or updates the trigger asset for one recipe entry. Does nothing in a dry run.
Declaration
public static void Write(SerenityRecipeImportContext context, string sectionName, string id, string relativeOutput, Func<string, UnityEventDispatcherSignalDefinition> buildSignalDefinition, List<string> warnings)
Parameters
| Type | Name | Description |
|---|---|---|
| SerenityRecipeImportContext | context | The import context. |
| string | sectionName | The section reporting the outcome. |
| string | id | The entry's recipe id, baked into the signal and stamped on the trigger asset. |
| string | relativeOutput | The entry's own relative output path; the trigger lands beside it. |
| Func<string, UnityEventDispatcherSignalDefinition> | buildSignalDefinition | Builds an unregistered trigger pre-wired for |
| List<string> | warnings | Collects messages the caller reports against the entry. |