public void Start() { if (Path.IsCurved) { _splineCurve = new SplineCurve(); UpdateCurvePoints(); } }
private Vector2[] GetDivededPoints(int ind) { var points = new Vector2[11]; var pointInd = 0; var indexes = GetSplinePointIndexes(ind, true); Vector2 a = Waypoints[indexes[0]].transform.position; Vector2 b = Waypoints[indexes[1]].transform.position; Vector2 c = Waypoints[indexes[2]].transform.position; Vector2 d = Waypoints[indexes[3]].transform.position; for (float t = 0; t <= 1.001f; t += 0.1f) { points[pointInd++] = SplineCurve.GetPoint(a, b, c, d, t); } return(points); }