Skip to content

ActionExecutedEventArgs

Namespace: FireSoftworks.Interaction
Type: Class
Assembly: FireSofworks.InteractionSystem

Payload for the IInteractor.ActionExecuted C# event and the onActionExecuted UnityEvent. Fired after an action completes execution.

public class ActionExecutedEventArgs

Constructor

public ActionExecutedEventArgs(
IInteractable target,
IInteractableAction action,
InteractionResult result)

Fields

Target

public readonly IInteractable Target;

The interactable object that was targeted.


Action

public readonly IInteractableAction Action;

The action that was executed.


Result

public readonly InteractionResult Result;

The outcome of the execution. Check Result.Success and Result.Message for details.


Usage

interactor.ActionExecuted += (ActionExecutedEventArgs args) =>
{
if (args.Result.Success)
audioSource.PlayOneShot(successClip);
else
Debug.LogWarning($"Action failed: {args.Result.Message}");
};