Methods

MethodDescription
AddDropEvent(System.Action<Action> callback)Registers a callback to be invoked with the dropped Action when a drag lands on this drop zone. Multiple callbacks can be registered; all are called in registration order.
OnDrop(PointerEventData)IDropHandler implementation — sets DragAndDrop.dragCaptured = true and invokes all registered callbacks with the dragged Action.

Usage Example

// On a GameObject with a DropActionEventCaller component:
[SerializeField] DropActionEventCaller dropZone;

void Start()
{
    dropZone.AddDropEvent(OnInstructionDropped);
}

void OnInstructionDropped(Action action)
{
    PlayerInstruction instruction = action.CreateInstruction();
    // do something with the instruction
}
ℹ️