Table of Contents

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

TContext

The context type that must implement ElectricDrill.AstraRpgFramework.Contexts.IHasEntity.

Inheritance
object
GameActionBase
GameAction<TContext>
SetEntityOverrideOnDeathGameActionSO<TContext>
Implements
IExecutable<TContext>
ITaggable
Derived
Inherited Members
GameAction<TContext>.Tags
GameAction<TContext>.DisplayName
GameAction<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

context TContext

The context object containing information needed for execution.

cancellationToken CancellationToken

Token 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.