# Item Drag Area UGUI

## 🖱️ ItemDragAreaUGUI Class

Provides an area (canvas) where draggable UI elements can be added and moved. Requires a Canvas component.

> **Namespace:** `Esper.Inventool.UI.UGUI`\
> **Access:** `public`\
> **Type:** `class`\
> **Attributes:** `[RequireComponent(typeof(Canvas))]`\
> **Inherits:** `MonoBehaviour`

***

### 📦 Fields

| Access          | Field      | Type               | Description                             |
| --------------- | ---------- | ------------------ | --------------------------------------- |
| `public`        | `canvas`   | `Canvas`           | The canvas component for the drag area. |
| `public`        | `area`     | `RectTransform`    | The RectTransform of the drag area.     |
| `public static` | `Instance` | `ItemDragAreaUGUI` | The active instance (singleton).        |

***

### 🧰 Methods

| Access    | Method                                | Returns | Description                                                         |
| --------- | ------------------------------------- | ------- | ------------------------------------------------------------------- |
| `private` | `Awake()`                             | `void`  | Initializes singleton, caches `canvas` and `area`.                  |
| `public`  | `Clear()`                             | `void`  | Destroys all child game objects inside the drag area.               |
| `public`  | `Add(RectTransform rectTransform)`    | `void`  | Parents a RectTransform to the drag area and resets rotation/scale. |
| `public`  | `Remove(RectTransform rectTransform)` | `void`  | Destroys the provided RectTransform's game object.                  |
