public City(HexRef xref, CityDisplay display) { name = NameGeneration.RandomCityName(); //color = Random.ColorHSV(0,1,1,1,0.99f,0.99f); this.hexRef = xref; this.cityDispaly = display; this.cityDispaly.Name = name; //this.display.SetColor(color); }
City spawnCity(HexRef xref) { Vector3 position = xref.WorldPosition; position.z = -0.3f; GameObject city = Instantiate(cityPrefab, position, cityPrefab.transform.localRotation, transform) as GameObject; cityObjs.Add(city); CityDisplay disp = city.GetComponent <CityDisplay>(); City newCity = new City(xref, disp); cities.Add(newCity); return(newCity); }