void OnDrawGizmos() { if (curvePath == null) { return; } Vector3[] points = curvePath.GetResultPoints(); // // for (int i = 0; i < points.Length; ++i) { // Gizmos.DrawSphere (points [i], 0.2f); // } }
void Start() { curvePath = new CurvePath(); curvePath.SetControlPoints(controlPoints); Vector3[] points = curvePath.GetResultPoints(); for (int i = 0; i < points.Length; ++i) { GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); sphere.transform.position = points [i]; sphere.transform.localScale = new Vector3(2, 2, 2); sphere.GetComponent <Renderer> ().material.color = Random.ColorHSV(); } }