1.8 KiB
1.8 KiB
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
-
Attach this script to any node that should only appear on a specific platform.
-
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.
- Attach the script to a placeholder node.
- 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
- Attach the script to your node.
- Set
default Position
in the Inspector. - The position updates automatically in mobile landscape / portrait mode.