示例#1
0
    public void CreateCityNamePlate(City city, GameObject cityGO, Dictionary <City, GameObject> cityToGOMap, Dictionary <GameObject, City> goToCityMap)
    {
        GameObject         nameGO      = Instantiate(cityNamePlatePrefab, this.transform);
        MapObjectNamePlate namePlateGO = nameGO.GetComponent <MapObjectNamePlate>();

        namePlateGO.target = cityGO;
        namePlateGO.GetComponentInChildren <Text>().text = city.name;
        nameGO.GetComponentInChildren <Button>().onClick.AddListener(delegate { actionController.SelectCity(hexMap.GetCityFromGO(cityGO)); });
        uiController.MapCityToNameplate(city, namePlateGO);
    }
示例#2
0
    public void CreateZoneNamePlate(Zone zone, GameObject zoneGO, Dictionary <Zone, GameObject> zoneToGOMap)
    {
        // Don't want zone nameplates for city centers -- just a city nameplate
        if (zone.GetZoneType() == Zone.ZONE_TYPE.CITY_CENTER)
        {
            return;
        }

        GameObject         nameGO      = Instantiate(zoneNamePlatePrefab, this.transform);
        MapObjectNamePlate namePlateGO = nameGO.GetComponent <MapObjectNamePlate>();

        namePlateGO.target = zoneGO;
        namePlateGO.GetComponentInChildren <TextMeshProUGUI>().text = SpriteText.ZONE_SPRITE[(int)zone.GetZoneType()] + " " + zone.GetPopulation().ToString();
        nameGO.GetComponentInChildren <Button>().onClick.AddListener(delegate { actionController.SelectZone(zone); });
        uIController.MapZoneToNameplate(zone, namePlateGO);
    }
 public void MapZoneToNameplate(Zone zone, MapObjectNamePlate np)
 {
     zoneNamePlates[zone] = np;
 }
 public void MapCityToNameplate(City city, MapObjectNamePlate np)
 {
     cityNamePlates[city] = np;
 }