public Tile getBestTile(List<Tile> open_list) { /*foreach(Tile t in open_list){ //Debug.Log("OPENLIST TILE SCORE:" + " [" + t.x_pos.ToString() + ","+ t.z_pos.ToString() + "]" + " G: " + t.getGScore().ToString() + ", F: " + t.getFScore().ToString()); }*/ Tile temp = new Tile (); foreach (Tile t in open_list) { //Debug.Log("Get best tile from open list -> Tile: " + t.x_pos.ToString() +"," + t.z_pos.ToString() + " f score: " + t.getFScore().ToString()); if (t.getFScore () <= temp.getFScore () || temp.getFScore () == 0) { // temp = t; } } //Debug.Log("RETURNED BEST: " + temp.x_pos.ToString() + "," + temp.z_pos.ToString()); return temp; }