Пример #1
0
 void OnDrawGizmos()
 {
     foreach (AbstractPathCurve curve in curves)
     {
         GizmoUtils.DrawPathGizmo(curve.Points);
     }
 }
Пример #2
0
    void OnDrawGizmos()
    {
        Vector3 center;
        float   startAngle;

        //this.points = CalculateArcPointsCW(this.startPoint + transform.position, this.startDirection, this.radius, this.angle, this.segments, out center, out startAngle);
        //this.points = CalculateArcPointsCW(transform.position, this.startDirection, this.radius, this.angle, this.segments, out center, out startAngle);
        this.points = CalculateArcSequence(transform.position, this.startDirection, this.radius, this.angle, this.segments, out center, out startAngle);

        // Given a Startpoint...
        Gizmos.color = Color.magenta;
        Gizmos.DrawSphere(transform.position, this.radius / 10f);

        // ... and the startDirection --> calculate the center of the circle:
        Gizmos.color = Color.blue;
        Gizmos.DrawSphere(center, radius / 8);

        if (this.points.Count > 1)
        {
            Gizmos.color = Color.gray;
            Gizmos.DrawLine(transform.position, center);
            Gizmos.DrawLine(points[points.Count - 1], center);

            ////Gizmos.color = Color.yellow;
            ////Gizmos.DrawSphere(zeroPoint + transform.position, Radius / 10);
            //Gizmos.color = Color.yellow;
            //Gizmos.DrawLine(startPoint + transform.position, (startPoint + startDirection.normalized) + transform.position);

            //StartAngle = 270f - MathUtils.AngleToZAxis(Center - startPoint);
            //Handles.Label(startPoint + new Vector3(0f, 0f, -0.3f), StartAngle + "");


            GizmoUtils.DrawPathGizmo(this.points);
            //Debug.Log("DarwArc");

            Gizmos.color = Color.green;
            Gizmos.DrawSphere(this.points[0], radius / 10);

            Gizmos.color = Color.red;
            Gizmos.DrawSphere(this.points[this.points.Count - 1], radius / 10);
        }
    }