using UnityEngine;

public class FaceoffSpotHelper : MonoBehaviour
{
    [Header("Visual Settings")]
    [SerializeField] private Color gizmoColor = Color.red;
    [SerializeField] private float circleRadius = 1.0f;

    void OnDrawGizmos()
    {
        Gizmos.color = gizmoColor;

        // Draw circle on ice
        DrawCircle(transform.position, circleRadius, 32);

        // Draw cross in center
        Gizmos.DrawLine(
            transform.position + Vector3.left * circleRadius * 0.3f,
            transform.position + Vector3.right * circleRadius * 0.3f
        );
        Gizmos.DrawLine(
            transform.position + Vector3.forward * circleRadius * 0.3f,
            transform.position + Vector3.back * circleRadius * 0.3f
        );
    }

    void DrawCircle(Vector3 center, float radius, int segments)
    {
        float angle = 0f;
        Vector3 lastPoint = center + new Vector3(radius, 0, 0);

        for (int i = 0; i <= segments; i++)
        {
            angle = (i / (float)segments) * 360f * Mathf.Deg2Rad;
            Vector3 newPoint = center + new Vector3(
                Mathf.Cos(angle) * radius,
                0,
                Mathf.Sin(angle) * radius
            );

            Gizmos.DrawLine(lastPoint, newPoint);
            lastPoint = newPoint;
        }
    }
}