TeleporterDestination - jimdroberts/FishMMO GitHub Wiki
Represents a destination point for teleporters in the scene. Used to visually indicate and mark teleporter endpoints in the Unity Editor.
-
public Color GizmoColor
The color used to draw the gizmo for this teleporter destination in the Unity Editor. Defaults to forest green for visibility.
-
void OnDrawGizmos()
Draws a gizmo in the editor to visually represent the teleporter destination. If a Collider is attached, draws the collider's gizmo; otherwise, draws a wire cube at the object's position.
- Attach this script to a GameObject in your scene to mark it as a teleporter destination.
- Optionally, add a Collider component to the GameObject for more accurate visualization.
- Adjust the
GizmoColor
field in the Inspector to change the gizmo's color (Editor only).
// Example 1: Marking a teleporter destination in the scene
// Attach TeleporterDestination to a GameObject at the desired location.
// Optionally, add a Collider for custom gizmo visualization.
// Set GizmoColor for editor clarity.
- Use distinct gizmo colors for different teleporter destinations to avoid confusion in the editor.
- Add a Collider to the destination GameObject for precise area visualization.
- Keep destination GameObjects clearly named and organized in the scene hierarchy.