Exemple #1
0
        public override void Init(GameManager gameManager)
        {
            base.Init(gameManager);

            LanguageDialog.Init(gameManager);
            FbDialog.Init(gameManager);

            UIEventListener.Get(NewGameButton).onClick           += OnNewGameButtonClick;
            UIEventListener.Get(SaveButton).onClick              += OnSaveClick;
            UIEventListener.Get(CloseObject).onClick             += OnCloseClick;
            UIEventListener.Get(NewGameYesButton).onClick        += OnNewGameYesButtonClick;
            UIEventListener.Get(NewGameNoButton).onClick         += OnNewGameNoButtonClick;
            UIEventListener.Get(MoveCarButton).onClick           += OnMoveCarClick;
            UIEventListener.Get(MoveCarConfrimOk).onClick        += OnMoveCarConfrimClick;
            UIEventListener.Get(MoveCarConfrimCancel).onClick    += OnMoveCarCancelClick;
            UIEventListener.Get(PlayerRespwanButton).onClick     += OnPlayerRespawnClick;
            UIEventListener.Get(PlayerRespawnConfrimYes).onClick += OnPlayerRespawnConfrimClick;
            UIEventListener.Get(PlayerRespawnConfrimNo).onClick  += OnPlayerRespawnNoClick;
            UIEventListener.Get(ExitGameButton).onClick          += OnExitButtonClick;
            UIEventListener.Get(ExitGameConfirm).onClick         += OnExitGameConfirm;
            UIEventListener.Get(ExitGameCancel).onClick          += OnExitGameCancel;
            UIEventListener.Get(AchievementsButton).onClick      += OnAchievementsClick;
            UIEventListener.Get(LeaderboardsButton).onClick      += OnLeaderboarsClick;
            UIEventListener.Get(ResetAchievementsButton).onClick += OnResetAchievmentsClick;
            UIEventListener.Get(CloudSaveButton).onClick         += OnSaveCloudClick;
            UIEventListener.Get(LoadFromCloud).onClick           += OnLoadFromCloudClick;

            var defalutSensitivity = 0.12f;

            ExitGameButton.SetActive(false);
#if UNITY_ANDROID
            defalutSensitivity = 0.12f;
            ExitGameButton.SetActive(true);
#endif
            var sensitivity = PlayerPrefs.GetFloat("LookPadSensitivity", defalutSensitivity);
            SetSensitivity(sensitivity, true);

            GraphicQuality.value = (float)QualityManager.CurrentQuality / 3.0f;
            SetGraphicLevelText((int)QualityManager.CurrentQuality, GraphicLevelLabel);

            WaterQuality.value = (float)QualityManager.CurrentWaterQuality / 2.0f;
            SetGraphicLevelText((int)QualityManager.CurrentWaterQuality, WaterLevelLabel);

            ControlSensitivitySlider.onDragFinished += OnSensitivity;
            GraphicQuality.onDragFinished           += OnChangeGraphicQuality;
            WaterQuality.onDragFinished             += OnChangeWaterQuality;

#if UNITY_ANDROID
            CloudSaveButton.SetActive(true);
            LoadFromCloud.SetActive(true);
#else
            CloudSaveButton.SetActive(false);
            LoadFromCloud.SetActive(false);
#endif
        }