ActionVariableReferenceMenu

Editor popup menu for binding an action variable to reference another variable from a parent action.

Definition

Namespace: Paragon.Core.ActionSystem.Editor Assembly: Paragon.Editor.dll

public class ActionVariableReferenceMenu

Description

ActionVariableReferenceMenu provides a popup interface for selecting which parent variable an ActionVariable should reference. It traverses the action hierarchy to find compatible variables based on type matching.

circle-info

This class is used internally by ActionVariableDrawer and appears when clicking the reference button on an ActionVariable field.

Constructor

ActionVariableReferenceMenu(ActionVariableDrawer)

Creates a new reference menu instance.

public ActionVariableReferenceMenu(ActionVariableDrawer drawer)
Parameter
Type
Description

drawer

ActionVariableDrawer

The parent drawer managing the variable

Methods

Show(Rect)

Displays the popup menu at the specified position.

Parameter
Type
Description

buttonRect

Rect

Screen position to anchor the popup

Behavior

When displayed, the menu:

  1. Traverses parent actions in the inspector hierarchy

  2. Collects all ActionVariables containers from parent actions

  3. Filters variables by type compatibility with the current variable

  4. Displays selectable options including "None" to clear references

circle-info

Variable names are automatically formatted with ObjectNames.NicifyVariableName for display.

Type Matching

A variable is included in the selection if its type is assignable to the current variable's type. This allows selecting base types when the variable expects a derived type.

See Also

Last updated

Was this helpful?