Example #1
0
 public override void UpdateData()
 {
     lblCityName.text        = CityInfoDatas.CityInfo.text;
     lblLandValue.text       = CityInfoDatas.FormatMoney((long)CityInfoDatas.CityInfo.value, false);
     lblDistricts.text       = CityInfoDatas.DistrictsCount.text;
     lblBuildings.text       = CityInfoDatas.BuildingCount.text;
     lblTrees.text           = CityInfoDatas.TreeCount.text;
     lblTouristsAverage.text = CityInfoDatas.TouristsAverage.text;
 }
Example #2
0
        public void setGameState()
        {
            bool pause = CityInfoDatas.isGamePaused();

            if (btnPlay != null)
            {
                btnPlay.activeStateIndex = (pause ? 0 : 1);
                int speed = Singleton <SimulationManager> .instance.SelectedSimulationSpeed;
                btnSpeed.activeStateIndex = speed - 1;
            }
        }
Example #3
0
        public override void LateUpdate()
        {
            base.LateUpdate();

            if (GamePauseState != CityInfoDatas.isGamePaused())
            {
                GamePauseState = CityInfoDatas.isGamePaused();
                setGameState();
            }

            if (Singleton <SimulationManager> .exists)
            {
                if (GameSpeed != Singleton <SimulationManager> .instance.SelectedSimulationSpeed)
                {
                    GameSpeed = Singleton <SimulationManager> .instance.SelectedSimulationSpeed;
                    setGameState();
                }
            }

            showtime += Time.deltaTime;

            if (showtime >= 1f) // 每秒显示一次
            {
                showtime = 0f;
                UpdateLocalTimeText();
            }

            if (Singleton <AudioManager> .exists && _savePanel != null)
            {
                if (!_savePanel.isVisible)
                {
                    Singleton <AudioManager> .instance.MuteAll = ExtendedInfoManager.AudioMuteAll;
                    if (btnMuteAudioContainer != null)
                    {
                        btnMuteAudioContainer.opacity = Singleton <AudioManager> .instance.MuteAll ? 0.1f : 0.5f;
                    }
                }
            }

            if (gameTimeSprite != null)
            {
                if (CityInfoDatas.RushHourUI == null)
                {
                    barTime.color      = gameTimeSprite.color;
                    barTime.fillAmount = gameTimeSprite.fillAmount;
                }
            }
        }
        float getFillAmount(float value, float total)
        {
            float v = CityInfoDatas.GetPercentValue((int)value, (int)total, true);

            return(v / 100);
        }