Class SetEntityOverrideOnDeathGameActionSO<TContext>
- Namespace
- ElectricDrill.AstraHealth.GameActions.Actions
- Assembly
- com.electricdrill.astra-health.Runtime.dll
Base generic game action that assigns (or clears) the OverrideOnDeathGameAction field. Useful for one-shot mechanics such as "resurrect on first death": configure a CompositeAction that resurrects the entity and then executes this action with ElectricDrill.AstraHealth.GameActions.Actions.SetEntityOverrideOnDeathGameActionSO<TContext>._newOverrideGameAction set to null, so the override is cleared and subsequent deaths use the default config action.
Connect to any GameEventListener whose payload implements ElectricDrill.AstraRpgFramework.Contexts.IHasEntity,
such as EntityDiedGameEventListener, DamageResolutionGameEventListener, or
directly from an EntityHealth reference.
public abstract class SetEntityOverrideOnDeathGameActionSO<TContext> : GameAction<TContext>, IExecutable<TContext>, ITaggable where TContext : IHasEntity
Type Parameters
TContextThe context type that must implement ElectricDrill.AstraRpgFramework.Contexts.IHasEntity.
- Inheritance
-
objectGameActionBaseGameAction<TContext>SetEntityOverrideOnDeathGameActionSO<TContext>
- Implements
-
IExecutable<TContext>ITaggable
- Derived
- Inherited Members
-
GameAction<TContext>.TagsGameAction<TContext>.DisplayNameGameAction<TContext>.ExecuteAsyncForUnityEvent(TContext)GameAction<TContext>.OnOperationCanceled()
Methods
ExecuteAsync(TContext, CancellationToken)
Executes the action asynchronously with the provided context. Override this method to implement your action logic.
public override Awaitable ExecuteAsync(TContext context, CancellationToken cancellationToken = default)
Parameters
contextTContextThe context object containing information needed for execution.
cancellationTokenCancellationTokenToken to cancel the operation. MonoBehaviour owners can use their "destroyCancellationToken" to automatically cancel when destroyed.
Returns
- Awaitable
An Awaitable that completes when the action finishes.