public static int Redraw(this RageSpline rageSpline, bool triangulate, bool calculateNormals, bool calculatePhysics, int startNormals, float percentNormals) { rageSpline.SetVertexCount(rageSpline.GetVertexCount()); if (Mathf.Abs(rageSpline.gameObject.transform.localScale.x) <= 0f || Mathf.Abs(rageSpline.gameObject.transform.localScale.y) <= 0f) { return(startNormals); } int points = rageSpline.GetVertexCount() + 1; int end = (int)(points * percentNormals); if (end > points) { end = points; } if (calculateNormals) { ProgressivePrecalcNormals(rageSpline, startNormals, end); } GenerateMesh(rageSpline, triangulate); if (calculatePhysics) { rageSpline.RefreshPhysics(); } return(end >= points ? 0 : end); }