public int VertexCount =
50;
public float Radius =
1;
public Vector3 Offset;
void OnDrawGizmos()
{
float deltaTheta = (
2f * Mathf.PI) / VertexCount;
float theta =
0f;
Vector3 oldPos = transform.position;
for (
int i =
0; i < VertexCount +
1; i++)
{
Vector3 pos =
new Vector3(Radius * Mathf.Cos(theta), Radius * Mathf.Sin(theta),
0f);
Gizmos.DrawLine(oldPos, transform.position + pos + Offset);
Gizmos.color = Color.red;
oldPos = transform.position + pos + Offset;
theta += deltaTheta;
}
}