CharacterRespawnPosition - jimdroberts/FishMMO GitHub Wiki
CharacterRespawnPosition is a MonoBehaviour for FishMMO that marks a character's respawn position in the scene. It draws a gizmo for visualization in the Unity editor, making it easy to identify and adjust respawn points during level design.
#if UNITY_EDITOR
-
public Color GizmoColor
The color used to draw the respawn position gizmo in the editor. #endif
#if UNITY_EDITOR
-
void OnDrawGizmos()
Draws a gizmo at the respawn position for visualization in the Unity editor. #endif
- Attach the CharacterRespawnPosition component to a GameObject in your scene to mark it as a respawn point.
- Optionally, adjust the GizmoColor field to customize the gizmo's appearance in the editor.
// Example 1: Adding a respawn position in the Unity Editor
// 1. Add the CharacterRespawnPosition component to a GameObject.
// 2. The respawn position will be visualized with a gizmo in the scene view.
// Example 2: Customizing the gizmo color
characterRespawnPosition.GizmoColor = Color.green;
- Use this component to clearly mark and visualize all character respawn points in your scenes.
- Adjust GizmoColor to differentiate between different types of respawn points if needed.
- Document the purpose and placement of each respawn point for maintainability.