void Start()
 {
     if (spline == null)
     {
         spline = new CatmullRom(controlPoints, resolution, closedLoop);
     }
 }
示例#2
0
 void Update()
 {
     if (spline != null)
     {
         spline.Update(controlPoints);
         spline.Update(resolution, closedLoop);
         spline.DrawSpline(Color.white);
         transform.position = LerpOverNumber(spline.GetPoints(), time);
     }
     else
     {
         spline = new CatmullRom(controlPoints, resolution, closedLoop);
     }
 }
        void Update()
        {
            if (spline != null)
            {
                spline.Update(controlPoints);
                spline.Update(resolution, closedLoop);
                spline.DrawSpline(Color.white);

                if (drawNormal)
                {
                    spline.DrawNormals(normalExtrusion, Color.red);
                }

                if (drawTangent)
                {
                    spline.DrawTangents(tangentExtrusion, Color.cyan);
                }
            }
            else
            {
                spline = new CatmullRom(controlPoints, resolution, closedLoop);
            }
        }