Action Variables
Editor tooling for the Action Variable system. Provides custom Odin Inspector drawers and popup menus for creating, displaying, referencing, and removing action variables directly within the Unity Inspector.
Architecture
Data Flow
Overview
Root drawer for the ActionVariables container — renders header, foldout, field/dynamic variable lists
Per-variable drawer — renders value field or reference display, link toggle, and delete button
Popup menu for creating new dynamic variables with a name and type
Popup menu for selecting a variable reference from parent Actions
How They Work Together
ActionVariablesDrawer is the entry point. When an
ActionVariablesinstance appears in the Inspector, this drawer renders a collapsible "Variables" section with a + button.Clicking + opens ActionVariableCreateMenu, which lets the user pick a type and enter a name to create a new dynamic variable via
ActionVariables.AddVariable().Each variable (field or dynamic) is drawn by ActionVariableDrawer, which shows either the inline value editor or a reference label.
The link toggle on each variable switches between direct-value mode and reference mode. In reference mode, a dropdown button opens ActionVariableReferenceMenu.
ActionVariableReferenceMenu walks up the Inspector property tree to find parent
Actionnodes, collects all compatible variables, and lets the user bind a reference viaActionVariable.SetReference().The trash button on each variable calls
ActionVariables.RemoveVariable()— but only for dynamic variables (field variables are not removable).
See Also
ActionVariables — runtime variable container
ActionVariable — runtime variable class
Action — base class that owns ActionVariables
Action System — system overview
Last updated