Class 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.
Implements
Inherited Members
Namespace: Serenity.ProjectRecipe.Infrastructure.Editor.Importers
Assembly: Serenity.UnityProjectRecipe.Infrastructure.Editor.dll
Syntax
public sealed class AchievementRecipeImporter : RecipeSectionImporterBase, ISerenityRecipeSectionImporter
Remarks
The flat authored fields are applied through AchievementDefinitionCreator.Input, which is where the module already states what "everything one authored achievement is made of" means — a second copy here would drift the day a field is added. The surrounding create/update is the recipe's own TryUpsert<T>(SerenityRecipeImportContext, string, string, Action<T>, bool) rather than Create(Input): an import must resolve outcomes without writing during a dry run, and must leave Addressables registration to the single pass the engine runs at the end.
Validation here covers what the recipe document can get wrong — a blank or repeated id, a value the asset
cannot hold, an icon or a condition type that does not resolve. The deeper authoring rules
(AchievementAuthoringRules) run against the real assets afterwards, because they judge a condition
tree and a recipe only carries the description of one.
Constructors
AchievementRecipeImporter()
Declaration
public AchievementRecipeImporter()
Properties
ModuleLabel
The Addressables module label applied to this section's created/updated assets when the run registers them (see Run(SerenityRecipe, string, RecipeRunMode, SerenityRecipeReport)). Null for sections whose assets are not registered as Addressable (generic/deferred sections, or sections with no module label of their own).
Declaration
public override string ModuleLabel { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Order
Declaration
public override int Order { get; }
Property Value
| Type | Description |
|---|---|
| int | Execution order (ascending). Typed sections run first, the generic |
Overrides
SectionName
Declaration
public override string SectionName { get; }
Property Value
| Type | Description |
|---|---|
| string | The recipe section this importer handles (used for reporting), e.g. |
Overrides
Methods
Import(SerenityRecipeImportContext)
Creates or updates this section's assets. In a dry run the context suppresses writes, so this only resolves and records the would-be outcomes. Not called when the report has blockers.
Declaration
public override void Import(SerenityRecipeImportContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| SerenityRecipeImportContext | context | The shared import context. |
Overrides
Validate(SerenityRecipeImportContext)
Validates this section against the recipe and project, reporting errors/warnings/info. Must not modify any asset. Called for every run mode.
Declaration
public override void Validate(SerenityRecipeImportContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| SerenityRecipeImportContext | context | The shared import context. |