public void DisplayPathFindingLine(bool active, SpaceObject objectSelected = null) { LinePath.enabled = false; if (active == true) { if (GridPathFinder.Instance.GetDestinationTiles().Count != 0) { Vector3 offsetVector = objectSelected.transform.Find("Body").position - objectSelected.GetReferenceTile().transform.position; LinePath.enabled = true; LinePath.SetVertexCount(GridPathFinder.Instance.GetPathFindingTiles().Count); for (int number = 0; number < GridPathFinder.Instance.GetPathFindingTiles().Count; number++) { LinePath.SetPosition(number, GridPathFinder.Instance.GetPathFindingTiles()[number].transform.position + offsetVector); } } } }