GoToStoreAction

Agent action that navigates the character to a shop table's display area. Resolves the DisplayArea from the target Table, then moves to its OuterSpot position using a MoveToTargetAction sub-action.

Definition

Namespace: Paragon.Townskeep.AgentSystem Assembly: Townskeep.dll

public class GoToStoreAction : AgentAction

Inheritance: ActionAgentAction → GoToStoreAction

Remarks

GoToStoreAction is a high-level navigation action used in agent shopping behavior. It combines shop system knowledge (TableDisplayAreaOuterSpot) with pathfinding (MoveToTargetAction).

Execution Flow

  1. OnBegin — Creates a new MoveToTargetAction and resolves the DisplayArea from the Table by casting table.Area to DisplayArea

  2. OnExecute — Initializes the move action with agent context, sets the target to displayArea.OuterSpot.position, and awaits movement completion

Table → DisplayArea Relationship

The Table component has an Area property of type TableArea. GoToStoreAction casts this to DisplayArea, which is a TableArea subclass representing a display counter. The OuterSpot is a Transform marking the customer-facing position.

Quick Lookup

Goal
How

Assign the target table

Set the table variable via Inspector or action.SetVariable("table", shopTable)

Navigate to the store

await goToStoreAction.ExecuteAsync()

Fields

Field
Type
Access
Description

table

Table

[Variable] private

The shop table to navigate to

Extension Points

This is a concrete (non-abstract) action. Override lifecycle hooks from Action if subclassing:

Method
Purpose

OnBegin()

Creates MoveToTargetAction and resolves DisplayArea from the table

OnExecute()

Initializes the move action and navigates to the outer spot

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation
circle-exclamation

Examples

In an ActionSequence (Inspector)

A typical shopping behavior sequence:

Programmatic Usage

See Also

Last updated