XCharts.ChartHelper.DrawTriangle(UnityEngine.UI.VertexHelper, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Color32)

Here are the examples of the csharp api XCharts.ChartHelper.DrawTriangle(UnityEngine.UI.VertexHelper, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Color32) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Source File : ChartHelper.cs
License : MIT License
Project Creator : BlueMonk1107

public static void DrawSector(VertexHelper vh, Vector3 p, float radius, Color32 color,
            float startDegree, float toDegree, int segments = 0)
        {
            if (segments <= 0)
            {
                segments = (int)((2 * Mathf.PI * radius) / CRICLE_SMOOTHNESS);
            }
            Vector3 p2, p3;
            float startAngle = startDegree * Mathf.Deg2Rad;
            float angle = (toDegree - startDegree) * Mathf.Deg2Rad / segments;
            p2 = new Vector3(p.x + radius * Mathf.Sin(startAngle), p.y + radius * Mathf.Cos(startAngle));
            for (int i = 0; i <= segments; i++)
            {
                float currAngle = startAngle + i * angle;
                p3 = new Vector3(p.x + radius * Mathf.Sin(currAngle),
                    p.y + radius * Mathf.Cos(currAngle));
                DrawTriangle(vh, p, p2, p3, color);
                p2 = p3;
            }
        }