21 lines
601 B
Plaintext
21 lines
601 B
Plaintext
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public static class GizmosUtils
|
|
{
|
|
public static int segments = 50;
|
|
|
|
public static void DrawCircle(Vector3 position, float radius)
|
|
{
|
|
Vector3 lastPoint = position + new Vector3(radius, 0, 0);
|
|
for (int i = 1; i <= segments; i++)
|
|
{
|
|
float angle = i * 2 * Mathf.PI / segments;
|
|
Vector3 newPoint = position + new Vector3(Mathf.Cos(angle), Mathf.Sin(angle)) * radius;
|
|
Gizmos.DrawLine(lastPoint, newPoint);
|
|
lastPoint = newPoint;
|
|
}
|
|
}
|
|
}
|