/// <summary> /// Draws lines representing entity paths. /// </summary> private void DrawLines() { if (drawn) { RemoveLines(); } drawn = true; List <Vector3> playerPositions; List <Vector3>[] lemmingPositions; if (logFile == null) { playerPositions = logger.playerPositions; lemmingPositions = logger.lemmingPositions; } else { string logText = logFile.text; int currentIndex = InputUtil.GetIndexAfter(logText, "Player:\n"); playerPositions = InputUtil.ParseVectorList(logText, ref currentIndex); List <List <Vector3> > lemmingPositionsList = new List <List <Vector3> >(); while (currentIndex < logText.Length && logText[currentIndex] == 'L') { currentIndex = logText.IndexOf('(', currentIndex); lemmingPositionsList.Add(InputUtil.ParseVectorList(logText, ref currentIndex)); } int numLemmings = lemmingPositionsList.Count; lemmingPositions = new List <Vector3> [numLemmings]; for (int i = 0; i < numLemmings; i++) { lemmingPositions[i] = lemmingPositionsList[i]; } } DrawLine(playerPositions, playerPathColor, true); if (lemmingPositions != null) { foreach (List <Vector3> lemmingPath in lemmingPositions) { DrawLine(lemmingPath, lemmingPathColor); } } }