# Selector UGUI

## 🖱️ SelectorUGUI Class

The selector GameObject used for Inventool's uGUI support.

> **Namespace:** `Esper.Inventool.UI.UGUI`\
> **Access:** `public`\
> **Type:** `class`\
> **Inherits:** `MonoBehaviour`

***

### 📦 Fields

| Access   | Field           | Type            | Description            |
| -------- | --------------- | --------------- | ---------------------- |
| `public` | `canvas`        | `Canvas`        | Root canvas.           |
| `public` | `rectTransform` | `RectTransform` | Graphic RectTransform. |
| `public` | `animator`      | `Animator`      | Graphic animator.      |

***

### 🧰 Methods

| Access   | Method                   | Returns | Description                                           |
| -------- | ------------------------ | ------- | ----------------------------------------------------- |
| `public` | `SetActive(bool active)` | `void`  | Enable/disable selector; plays Unlock when activated. |
| `public` | `Unlock()`               | `void`  | Play "Unlocked" animation.                            |
| `public` | `Lock()`                 | `void`  | Play "Locked" animation.                              |

## Set Active

The `SetActive` method hides or shows the selector graphic. This accepts a bool parameter—if true, the selector will be visible. Otherwise, it will be hidden.

```csharp
mySelector.SetActive(true);
```

## Locking

### Lock

Plays the locked animation. The animator component must have an animation named 'Locked'.

```csharp
mySelector.Lock();
```

### Unlock

Plays the unlocked animation. The animator component must have an animation named 'Unlocked'.

```csharp
mySelector.Unlock();
```
