GA/Assets/Scripts/World.cs
/// <summary>
/// Draws all-time best route. 
/// </summary>
Draws all-time best route.
Draws all - time best route .
private void DrawBest() {
        for (int i = 0; i < newCities.Count; i++) {
            Destroy(newCities[i].gameObject);
        }
        newCities.Clear();
        for (int i = 0; i < allTimeBest.dna.Count; i++) {
            var city = Instantiate(cityPrefab, transform).GetComponent<City>();
            city.index = allTimeBest.dna[i].index;
            city.transform.position = new Vector3(allTimeBest.dna[i].transform.position.x + 13,
                                                  allTimeBest.dna[i].transform.position.y);
            newCities.Add(city);
        }
        allTimeBest.dna = newCities.ToList();
        allTimeBest.Draw();
    }
private void DrawBest ( ) { for ( int i = 0 ; i < newCities . Count ; i ++ ) { Destroy ( newCities [ i ] . gameObject ) ; } newCities . Clear ( ) ; for ( int i = 0 ; i < allTimeBest . dna . Count ; i ++ ) { var city = Instantiate ( cityPrefab , transform ) . GetComponent < City > ( ) ; city . index = allTimeBest . dna [ i ] . index ; city . transform . position = new Vector3 ( allTimeBest . dna [ i ] . transform . position . x + 13 , allTimeBest . dna [ i ] . transform . position . y ) ; newCities . Add ( city ) ; } allTimeBest . dna = newCities . ToList ( ) ; allTimeBest . Draw ( ) ; }
Draws all-time best route.
Draws all - time best route .