Static State

MemberTypeDescription
currentDraggingDragAndDropThe component currently being dragged, or null if no drag is in progress. Read by drop handlers to retrieve the associated Action.
dragCapturedboolSet to true by a drop handler when it accepts the drag. If false when the drag ends, the ghost copy is destroyed.
draggingbooltrue while a drag is in progress. Other systems check this flag to suppress hover effects.

Inspector Fields

FieldTypeDescription
leaveInstanceboolWhen true, a copy of the original stays in the palette while the ghost follows the cursor. When false, the original itself is dragged and returns if the drop is cancelled.
audioSourceAudioSourceAudioSource for drag SFX.
dragStartSoundAudioClipClip played when the drag begins.
dragEndSoundAudioClipClip played when the drag ends (captured or not).

Drag Lifecycle

PhaseWhat happens
OnBeginDragIf leaveInstance is true a copy is created at the original position. The dragged object is reparented to the canvas root, its alpha is set to 0.7, and raycasts are disabled so the pointer can reach drop zones beneath it. currentDragging, dragging, and dragCaptured are set.
OnDragThe ghost follows the cursor. InstructionSheet updates its insert indicator based on which layout the pointer is over.
OnEndDragAlpha and raycasts are restored. If dragCaptured is false the ghost is destroyed. Static state is reset.
ℹ️