Ejemplo n.º 1
0
        public Vector3 GetPoint(float t)
        {
            if (GetPoints().Length < 4)
            {
                return(Vector3.zero);
            }

            int i;

            if (t >= 1f)
            {
                t = 1f;
                i = GetPoints().Length - 4;
            }
            else
            {
                t  = Mathf.Clamp01(t) * CurveCount;
                i  = (int)t;
                t -= i;
                i *= 3;
            }
            return(transform.TransformPoint(Bezier.GetPoint(GetPoints()[i], GetPoints()[i + 1], GetPoints()[i + 2], GetPoints()[i + 3], t)));
        }
Ejemplo n.º 2
0
 public Vector3 GetPoint(float t)
 {
     return(transform.TransformPoint(Bezier.GetPoint(points[0], points[1], points[2], points[3], t)));
 }