// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2021-05-26 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** namespace G.UI { using UnityEngine; using UnityEngine.UI; /// /// /// partial class RateBox { #region Field #pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null [KUIFlag] GameObject _goPanel1; [KUIFlag] GameObject _goPanel2; [KUIFlag] Button _btnRating; [KUIFlag] Button _btnReject; [KUIFlag] Button _btnNext; [KUIFlag] Button _btnReject2; [KUIFlag] Slider _sldStars; #pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null #endregion #region Method /// /// /// public void InitView() { SetViewData(); _btnRating.onClick.AddListener(this.OnRatingBtnClick); _btnReject.onClick.AddListener(this.OnRejectBtnClick); _btnNext.onClick.AddListener(this.OnNextBtnClick); _btnReject2.onClick.AddListener(this.OnRejectBtn2Click); _sldStars.onValueChanged.AddListener(this.OnSliderValueChanged); } /// /// /// public void RefreshView() { _goPanel1.SetActive(true); _goPanel2.SetActive(false); } /// /// /// public void UpdateView() { } private void OnRatingBtnClick() { PlayerPrefs.SetInt("rate", 1); PlayerPrefs.Save(); if (_sldStars.value >= 4) { KPlatform.Instance.InAppRating(); } CloseWindow(this); } private void OnNextBtnClick() { PlayerPrefs.SetInt("rate", 2); PlayerPrefs.Save(); CloseWindow(this); } private void OnRejectBtnClick() { _goPanel1.SetActive(false); _goPanel2.SetActive(true); } private void OnRejectBtn2Click() { PlayerPrefs.SetInt("rate", 3); PlayerPrefs.Save(); CloseWindow(this); } private void OnSliderValueChanged(float value) { } #endregion } }