private void Update() { time += Time.deltaTime * speed; transform.position = smoothLine.GetPointAtTime(time, moveType); Vector3 lookDir = smoothLine.GetDirectionAtTime(time, transform.position, transform.forward, moveType); transform.rotation = Quaternion.LookRotation(lookDir); DoAnim(); }
private void OnDrawGizmosSelected() { if (autoUpdate) { smoothLine.UpdateWhenPathChanges(); } Gizmos.color = Color.yellow; float stepPercent = 1f / numObject; for (int i = 0; i < numObject; i++) { Vector3 pos = smoothLine.GetPointAtTime(stepPercent * i);; Gizmos.DrawSphere(pos, radius); } }