# Cocos Scene Setup
---

## Platform Node Spawner

Use this configuration to control which prefabs appear based on the current platform.

| Setting            | Value                | Description                                   |
|--------------------|----------------------|-----------------------------------------------|
| **Desktop Toggle** |  ✅ Enabled          | Show prefab on desktop                        |
| **Mobile Toggle**  |  ❌ Disabled         | Hide prefab on mobile                         |
| **Target Prefab**  |  `prefab name`       | Name of the prefab to be spawned              |


## Platform ui controller

1. Attach this script to any node that should only appear on a specific platform.

2. At runtime, the node will automatically be removed if it doesn’t match the active platform.

| Setting            | Value                | Description                                   |
|--------------------|----------------------|-----------------------------------------------|
| **Desktop Toggle** |  ✅ Enabled          | Show node on desktop                          |
| **Mobile Toggle**  |  ❌ Disabled         | Hide node on mobile                           |


## Node Spawner

Spawns a prefab at the same position as the original node and then removes the node.

#### Usage

- On scene start, the prefab replaces the node.
1. Attach the script to a placeholder node.
2. Set the `prefab` property in the Inspector.


## UI Mobile Landscape / Portrait  Position

Positions a node at a specific location when the device is in landscape / portrait mode on mobile.

#### Usage

1. Attach the script to your node.
2. Set `default Position` in the Inspector.
3. The position updates automatically in mobile landscape / portrait mode.

![Position](./img/default-setting.png)

## Orientation UI Controller

Manage UI visibility based on device orientation (landscape or portrait).

![Position](./img/orientation-ui-controller.png)

| Property            | Type    | Default   | Description                                                                                  |
|---------------------|---------|-----------|----------------------------------------------------------------------------------------------|
| **isLandscape**     | Boolean | true      | Indicates if the UI should be visible in landscape mode. Automatically syncs with ***isPortrait***. |
| **isPortrait**      | Boolean | false     | Indicates if the UI should be visible in portrait mode. Automatically syncs with ***isLandscape***. |
| **useActiveObject** | Boolean | false     | Visibility method:<br />- `false`: Uses opacity (0-255)<br />- `true`: Uses node active state       |

**Notes:**
- Automatically keeps landscape and portrait states in sync.
- Supports both opacity and active state for controlling visibility.
