コード例 #1
0
 void Start()
 {
     if (spline == null)
     {
         spline = new CatmullRom(controlPoints, resolution, closedLoop);
     }
 }
コード例 #2
0
ファイル: SplineTester.cs プロジェクト: thanik/BeatBot
 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);
     }
 }
コード例 #3
0
        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);
            }
        }