Properties

PropertyTypeDescription
instructionPlayerInstructionThe data object this widget is bound to.
containerIInstructionSequenceLayoutThe parent sequence layout, if this instruction is nested inside a Combo or similar. null for top-level instructions.
rectTransformRectTransformThe widget's root RectTransform.
anchorRectTransformY-position anchor used by the insert indicator to decide whether a drop targets the slot above or below this widget.
anchoredPositionVector2Shorthand for anchor.anchoredPosition.

Inspector Fields

FieldTypeDescription
lineNumberTMP_TextLabel showing the instruction's position in the sheet (1-based).
instructionNameTMP_TextLabel showing the instruction's displayName.
loopTextTMP_TextLabel showing the current loop count.
backgroundsImage[]Background sprites synced to the instruction's action tint color.
directionsSprite[]Direction arrow sprites in order: Up, Right, Down, Left.
directionButtonGameObjectDirection cycle button — hidden for instructions that do not use a direction (e.g. Wait).
loopsGameObjectLoop counter section container.
arrowsContainerGameObjectContainer for the directional arrow indicators.
increaseLoopButtonButtonIncrements the loop count (max 12).
decreaseLoopButtonButtonDecrements the loop count (min 1).
removeButtonButtonRemoves the instruction from the sheet.

Key Methods

MethodDescription
CreateInstance(PlayerInstruction, Action, Transform)Factory — instantiates the prefab, binds the instruction and action, sets backgrounds and labels. Returns the new layout.
Load(PlayerInstruction, Action, Transform)Restores a widget from saved data — same as CreateInstance but skips sounds and undo snapshots.
Remove()Removes this instruction from the sheet and destroys the GameObject.
IncreaseLoop()Increments the instruction's loop counter, capped at 12.
DecreaseLoop()Decrements the instruction's loop counter, floored at 1.
SetDirection(Direction)Sets the instruction's direction and updates the arrow sprite.
CycleDirection()Advances the direction Up → Right → Down → Left → Up. Wired to the direction button.
UpdateLineNumber()Refreshes the line number label from the widget's current sibling index.
SyncVirtualInstruction(Instruction)Called by the runner during execution to mirror the runtime clone's direction and loop count back to the UI.
ResetLayout()Restores the visual state from the instruction data after execution ends.
Validate()Delegates to instruction.Validate() and returns the result.
ℹ️