/// <summary> /// Draw orbit. All needed orbit data will be calculated if is not in playmode. /// Orbit points count is provided by SimControl /// </summary> /// <param name="body"></param> void DrawOrbitInEditorFor(CelestialBody body) { int pointsCount = (int)_simControl.orbitPointsCount; if (body.isActiveAndEnabled && !body.IsFixedPosition) { if (!Application.isPlaying) { if (_draggingObject == null || body == _draggingObject) { body.CalculateNewOrbitData(); } } var points = body.GetOrbitPoints(pointsCount); for (int i = 1; i < points.Length; i++) { Handles.DrawLine((Vector3)points[i - 1], (Vector3)points[i]); //Handles.DrawDottedLine( (Vector3)points[i - 1], (Vector3)points[i], 12f ); //pretty expensive for performance } } }