Class AchievementModuleWiring
The two steps that connect an authored achievements configuration to the rest of the project: giving every theme an achievements panel, and making the module install itself at boot.
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Editor.Builder
Assembly: Serenity.UnityAchievements.Infrastructure.Editor.dll
Syntax
public static class AchievementModuleWiring
Remarks
Kept apart from AchievementSettingsCreator because both touch assets a creation run does not
own — every UnityUiThemeDefinition in the project, and the boot profiles — so neither can live
inside the run's asset transaction: undoing them on a later failure would mean reverting other people's
assets. Both are best-effort, reporting a warning instead of throwing, so a project that already carries
its panels or its boot task is never blocked from writing its settings.
Fields
BootOrderRelationship
The named reason InstallBeforeMethodName is this module's boot-task default —
shared by CreateAchievementSettingsWindow's Installation-step prose and its
Serenity.Global.Infrastructure.Editor.InitializationPipeline.InstallTaskSectionGui so the two can never disagree.
Declaration
public static readonly InstallOrderRelationship BootOrderRelationship
Field Value
| Type | Description |
|---|---|
| InstallOrderRelationship |
InstallBeforeMethodName
The install method this module's task ideally runs BEFORE: InstallMenu's fan-out installs the
achievements view, so an InstallMethodName task placed after it silently installs
nothing. See Serenity.Global.Infrastructure.Editor.InitializationPipeline.InstallTaskAuthoring.ResolveDefaultInsertIndex(Serenity.InitializationPipeline.InterfaceAdapters.UnityInitializationPipelineProfile,System.String,System.Int32).
Declaration
public const string InstallBeforeMethodName = "InstallMenu"
Field Value
| Type | Description |
|---|---|
| string |
InstallMethodName
The UnitySerenityInstaller method a project's boot profile calls to install this module.
Declaration
public const string InstallMethodName = "InstallAchievements"
Field Value
| Type | Description |
|---|---|
| string |
Methods
TryRetrofitThemes(bool, ICollection<string>)
Gives every theme still missing one an achievements panel. A failure is reported into
warnings and answered with null, never thrown.
Declaration
public static AchievementModuleWiring.ThemeRetrofitSummary TryRetrofitThemes(bool registerAsAddressables, ICollection<string> warnings)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | registerAsAddressables | Whether created prefabs join the Serenity Addressables group. |
| ICollection<string> | warnings | Receives the failure message when the retrofit could not run. |
Returns
| Type | Description |
|---|---|
| AchievementModuleWiring.ThemeRetrofitSummary | What the run changed, or null when it could not run at all. |
TryWireInstallTask(IReadOnlyCollection<UnityInitializationPipelineProfile>, bool, ICollection<string>)
Ensures the InstallMethodName task asset exists — reusing the one the project already
ships rather than growing a duplicate — and inserts it into every profile in
targetProfiles, right before InstallBeforeMethodName when that profile
carries it. A failure is reported into warnings and answered with null.
Declaration
public static AchievementModuleWiring.InstallTaskOutcome TryWireInstallTask(IReadOnlyCollection<UnityInitializationPipelineProfile> targetProfiles, bool registerAsAddressables, ICollection<string> warnings)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyCollection<UnityInitializationPipelineProfile> | targetProfiles | The boot profiles to insert into. Null or empty ensures the task asset alone. |
| bool | registerAsAddressables | Whether a newly created task asset joins the Serenity Addressables group. |
| ICollection<string> | warnings | Receives every non-fatal issue the wiring surfaced. |
Returns
| Type | Description |
|---|---|
| AchievementModuleWiring.InstallTaskOutcome | What the wiring did, or null when it could not run at all. |
TryWireMenuOption(AchievementViewAuthoring, ICollection<string>)
Adds the "open the achievements view" option to the menu the author picked, through the same
MenuOptionTransitionAuthoring upsert the leaderboard wizard uses. The menu is an asset
this run does not own, so a failure is reported into warnings and answered with
null, never thrown.
Declaration
public static UnityMenuSettingsDefinition TryWireMenuOption(AchievementViewAuthoring view, ICollection<string> warnings)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementViewAuthoring | view | The view authoring block carrying the menu choice and the view id. |
| ICollection<string> | warnings | Receives the failure message when the option could not be wired. |
Returns
| Type | Description |
|---|---|
| UnityMenuSettingsDefinition | The menu that was edited, or null when nothing was wired. |