Skip to content

IInteractor

Namespace: FireSoftworks.Interaction
Assembly: FireSoftworks.Interaction
Type: Interface

Interface defining the core functionality of an interactor. Interactors are responsible for detecting interactable targets and managing the selection and execution of actions on those targets.

public interface IInteractor

Events

ActionExecuted

Fired after an action is successfully executed.

event Action<ActionExecutedEventArgs> ActionExecuted

ActionSelectionChanged

Fired when the player cycles to a different action.

event Action<ActionSelectionChangedEventArgs> ActionSelectionChanged

ActionsDiscovered

Fired when a target is focused and its actions are first discovered.

event Action<ActionsDiscoveredEventArgs> ActionsDiscovered

InteractionEnded

Fired when the interactor stops focusing on the current target.

event Action<InteractionLifecycleEventArgs> InteractionEnded

InteractionStarted

Fired when the interactor begins focusing on an interactable target.

event Action<InteractionLifecycleEventArgs> InteractionStarted

ShowActionsDiscovered

Fired when the UI should display the available actions for the focused target.

event Action<ActionsDiscoveredEventArgs> ShowActionsDiscovered

Methods

EndInteraction()

Cancels the current interaction and clears the target.

void EndInteraction()

ExecuteInteraction()

Executes the currently selected action.

void ExecuteInteraction()

GetVisibleActions()

Returns the list of actions that should be visible in the UI.

List<IInteractableAction> GetVisibleActions()

HandleInteraction()

Handles interaction input, either showing actions or executing the selected one.

void HandleInteraction()

IsInteracting()

Checks if the interactor is currently in interaction mode or has a target.

bool IsInteracting()

SelectAction(int)

Selects a specific action by index.

IInteractableAction SelectAction(int actionIndex)

Parameters

NameTypeDescription
actionIndexSystem.Int32

SelectNextAction()

Cycles to the next available action.

IInteractableAction SelectNextAction()

SelectPreviousAction()

Cycles to the previous available action.

IInteractableAction SelectPreviousAction()

ShowInteractions()

Enters interaction mode and shows the available actions.

void ShowInteractions()

Propertys

SelectedAction

Gets the currently selected action, or null if none is selected.

IInteractableAction SelectedAction { get; }

isInteractionAvailable

Indicates whether there is a currently focused interactable target.

bool isInteractionAvailable { get; }

isValidInteractionSelected

Indicates whether there is a valid selected action that can be executed.

bool isValidInteractionSelected { get; }