void setRageSpline(Vector2[] splinePoints) { rageSpline = GetComponent<RageSpline>(); rageSpline.ClearPoints(); for (int i=0;i<splinePoints.Length;i++) { rageSpline.AddPoint(0, new Vector3(splinePoints[i].x,splinePoints[i].y,0),new Vector3(0,0,0)); } rageSpline.RefreshMesh(); }
void setRageSpline(Vector2[] splinePoints) { IRageSpline rageSpline = GetComponent <RageSpline>(); rageSpline.ClearPoints(); for (int i = 0; i < splinePoints.Length; i++) { rageSpline.AddPoint(0, new Vector3(splinePoints[i].x, splinePoints[i].y, 0), new Vector3(0, 0, 0)); } rageSpline.RefreshMesh(); }
public void CreateNewLandscape() { //transform.position = new Vector3(0f,0f,0f); pointGapWidth = (startX2 - startX) / (float)(pointCount - 1); rageSpline.ClearPoints(); for (int i = 0; i < pointCount; i++) { float x = startX + (float)i * pointGapWidth; curSteepness = steepness + x * 0.00001f; rageSpline.AddPointWorldSpace(i, GetNewLandscapePoint(x), transform.right * pointGapWidth * 0.33f); } rageSpline.SetPoint(0, new Vector3(rageSpline.GetPosition(0).x, 0f, 0f)); rageSpline.SetPoint(1, new Vector3(rageSpline.GetPosition(1).x, 0f, 0f)); rageSpline.RefreshMesh(); }