private void ResetLineRenderer() { const int points = 100; var positions = new Vector3[points]; for (var i = 0; i < 100; i++) { positions[i] = curveBaseMath.CalcPositionByDistanceRatio(((float)i / (points - 1))); } lineRenderer.SetVertexCount(points); lineRenderer.SetPositions(positions); }
private void ResetLineRenderer() { const int points = 100; var positions = new Vector3[points]; for (var i = 0; i < 100; i++) { positions[i] = curveBaseMath.CalcPositionByDistanceRatio(((float)i / (points - 1))); } #if UNITY_5_5 lineRenderer.numPositions = points; #elif UNITY_5_6_OR_NEWER lineRenderer.positionCount = points; #else lineRenderer.SetVertexCount(points); #endif lineRenderer.SetPositions(positions); }