UGTK cat mascotUGTKengine within an engine Request access

UGTK / Toolkit / Component Module / DragDrop System Completed

Component Module — UGTK

Drag and Drop System

Summary

The Drag and Drop System is designed to manage the drag and drop functionality for UI elements. It leverages a state machine to handle various drag states, ensuring smooth and efficient interactions. The system includes components for managing drag events, state transitions, and object pooling to optimize performance.


Content


Modules Dependencies

The Drag and Drop System requires the following dependencies:

Ensure that these dependencies are correctly imported and configured in your project.

Carried inside the prefabs. These modules are not referenced by the assembly definition - the components are simply already attached to the prefabs this module ships. Remove one of them from the project and the prefab keeps its layout and loses that behaviour, with nothing in the console to say so.

Module Component, and the prefab carrying it
UtilitySystems/ActivationSystem Mn_GameObjectActivation (in DragDropObject)
UtilitySystems/EventSystem Mn_ZeroParametersController (in DragDropObject)
UtilitySystems/PoolingSystem Mn_Pooler (in DragDropObject)

Setup

  1. Add DragDropObject Prefab in your scene:


How To Use

  1. Setup DragDrop variables and events:

  1. Wire the two events: onDrag fires while the object is being carried, onDrop when it is released. Neither carries an argument — where the object landed is something the receiver decides, not something the dragger reports.

  2. Turn dragging on and off from code with SetDraggable(bool). An inventory that locks during a cutscene, a card that becomes unplayable, a piece already in its slot: all of them are this call.

Things worth knowing before shipping it:


Testing Scene


Technical Info

Scripts:


© 2026 Marcello De Bonis. All rights reserved

Real dependenciesOpen in the map →

Measured from the repository: code references (asmdef) plus prefab and asset GUIDs. Importing this module alone brings in 14 modules in total.