Exemplo n.º 1
0
    public static void DrawCircle(Vector3 position, float radius, Color c, float t, Object msg = null)
    {
        MyDebug.Log(msg);
        int   detail      = 12;
        float full_circle = 360f * Mathf.Deg2Rad;

        for (int i = 0; i < detail; i++)
        {
            float arc = full_circle / detail;
            MyDebug.DrawLine(position + new Vector3(radius * Mathf.Cos(arc * i), 0, radius * Mathf.Sin(arc * i)),
                             position + new Vector3(radius * Mathf.Cos(arc * (i + 1)), 0, radius * Mathf.Sin(arc * (i + 1))), c, t);
        }
    }