Exemplo n.º 1
0
    /// <summary>
    /// Calculates and draws a bezier curve with arrow
    /// </summary>
    private void BezierArrow()
    {
        Vector3        currentDirection = Quaternion.AngleAxis(currentAngle, new Vector3(-1, 0, 1).normalized) * Vector3.up;
        List <Vector3> bezierPoints     = new List <Vector3>();

        bezierPoints.Add(new Vector3(3, 0, 4));
        bezierPoints.Add(new Vector3(1, 0, 4));
        bezierPoints.Add(new Vector3(2, 0, 5));
        bezierPoints.Add(new Vector3(0, 0, 5));
        float bezSinParam = Mathf.Sin(lerpingHalfParam * 2 * Mathf.PI);

        CustomGizmos.BezierWithArrow(bezierPoints, 10, (bezSinParam + 1) / 2, arrowTipSize, currentDirection);
    }