Class AchievementToastAction
Turns an unlock into the transient popup the player actually sees, by re-dispatching it as a ShowToastSignal carrying the achievement's name, when ShowToastOnUnlock is on.
Namespace: Serenity.Achievements.Infrastructure.Events
Assembly: Serenity.UnityAchievements.Infrastructure.dll
Syntax
public sealed class AchievementToastAction : EventDispatcherAction<AchievementUnlockedSignal>
Remarks
An action rather than a call inside the service, so the notification stays a project decision: switch the setting off, or leave the Toast module uninstalled, and unlocks are still recorded and still mirrored — only the popup disappears.
Resolves its collaborators through ServiceLocatorBridge (via the base class'
TryResolveService) because EventDispatcher actions are instantiated via reflection and
cannot receive constructor injection. Never throws, and never warns per unlock: a project
that does not install achievements at all still constructs this action, so an unresolved
service is an ordinary state rather than a misconfiguration.
Text-only in this version: ShowToastSignal carries no icon payload, so the achievement's sprite is a documented follow-up rather than something quietly dropped here.
Constructors
AchievementToastAction()
Declaration
public AchievementToastAction()
Methods
Execute(AchievementUnlockedSignal)
Shows the unlocked achievement's name as a toast.
Declaration
protected override void Execute(AchievementUnlockedSignal signal)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementUnlockedSignal | signal | The unlock that just happened. |