Пример #1
0
 public void GenerateNewCity(string cityName, CountryToGlobalCountry.GenericCity cityData)
 {
 }
Пример #2
0
 public void InitalizeRefrenceCity(string cityName, CountryToGlobalCountry.GenericCity cityData)
 {
 }
Пример #3
0
 public void InitalizeUnknowCity(string cityName, CountryToGlobalCountry.GenericCity cityData)
 {
 }
Пример #4
0
    public void SelectCity(int cityIndex, CountryToGlobalCountry.GenericCity SelectedCity)
    {
        var cityName = wmslObj.GetCityHierarchyName(cityIndex);

        var cityInfoPanel = FindObjectOfType <CityInfoPanel>();

        var cityInfo = wmslObj.cities[cityIndex];

        //no relations or network
        cityInfoPanel.CityNoIntel.gameObject.SetActive(true);
        cityInfoPanel.CityNoLocalNewsInfo.gameObject.SetActive(true);
        cityInfoPanel.CityNoProductionInfo.gameObject.SetActive(true);
        cityInfoPanel.CityNoRumorInfo.gameObject.SetActive(true);
        cityInfoPanel.CityNoStatInfo.gameObject.SetActive(true);
        cityInfoPanel.CityStatsInfoPanel.SetActive(false);
        var mapFlag = helpers.LoadFlagFromCountryName(cityInfoPanel.CityStateText.text);

        //if its different selected from previous
        if (cityInfo.uniqueId != SelectedCity.index)
        {
            var countrygovernment = GameMapManger.SelectedCountryManager;
            if (countrygovernment != null)
            {
                var countryCities = countrygovernment.CountryCityControlList.FirstOrDefault(city => city.index == cityInfo.uniqueId);

                //if we have intel network etc

                if (countryCities != null)
                {
                    SelectedCity = countryCities;

                    cityInfoPanel.CityCrimeIndex.value           = cityInfoPanel.CrimeIndex = SelectedCity.CityCrimeIndex;
                    cityInfoPanel.CityTerrorIndex.value          = cityInfoPanel.TerrorIndex = SelectedCity.CityTerrorLevel;
                    cityInfoPanel.CityPropertyConstruction.value = cityInfoPanel.PropertyConstruction = SelectedCity.CityPropertyValue;
                    cityInfoPanel.CityEconomicIndex.value        = cityInfoPanel.EconomicIndex = SelectedCity.CityEconomicIndex;
                    cityInfoPanel.CityTradeIndex.value           = cityInfoPanel.TradeIndex = SelectedCity.CityTradeValue;
                    cityInfoPanel.CityResearchIndex.value        = cityInfoPanel.ResearchIndex = SelectedCity.CityResearchIndex;

                    cityInfoPanel.CityStatsInfoPanel.SetActive(true);
                }
                mapFlag = countrygovernment.CountryGovernment.CountryFlag;
                //do we have intel network?
                // do we have media sharing?
                // do we have trade deal?
                // do we have back-channel deal?
                //
                cityInfoPanel.CityNoIntel.gameObject.SetActive(false);
                cityInfoPanel.CityNoLocalNewsInfo.gameObject.SetActive(false);
                cityInfoPanel.CityNoProductionInfo.gameObject.SetActive(false);
                cityInfoPanel.CityNoRumorInfo.gameObject.SetActive(false);
                cityInfoPanel.CityNoStatInfo.gameObject.SetActive(false);

                cityInfoPanel.CityIntelReport.gameObject.SetActive(true);
                cityInfoPanel.CityLocalNews.gameObject.SetActive(true);
                cityInfoPanel.CityProductionReport.gameObject.SetActive(true);
                cityInfoPanel.CityRumorReport.gameObject.SetActive(true);
            }
            else
            {
                SelectedCity.index        = cityInfo.uniqueId;
                SelectedCity.location     = cityInfo.unity2DLocation;
                SelectedCity.population   = cityInfo.population;
                SelectedCity.name         = cityInfo.name;
                SelectedCity.provinceName = cityInfo.province;
            }
        }

        //get it from wahtever slected city was before
        cityInfoPanel.CityNameText.text       = string.Format("{0} {1}", SelectedCity.name, SelectedCity.isCapital ? "[Captial]" : string.Empty, SelectedCity.isCapital ? "[Province Captial]" : string.Empty);
        cityInfoPanel.CityProvinceText.text   = SelectedCity.provinceName;
        cityInfoPanel.CityStateText.text      = wmslObj.countryHighlighted.name;
        cityInfoPanel.CityPopulationText.text = string.Format("{0:n0}", SelectedCity.population);

        cityInfoPanel.CityControllingFlag.texture = mapFlag;
        // GameCityInfoPanel.SetActive(true);
        // GameCityInfoPanel.GetComponent<FadeObjectInOut>().FadeIn();
        gameObject.SetActive(true);
    }