// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2021-08-26 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** namespace G.UI { using TMPro; using UnityEngine; using UnityEngine.UI; /// /// /// partial class CityDetailBox { #region Field #pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null [KUIFlag] Button _btnClose; [KUIFlag] TextMeshProUGUI _tmpName; [KUIFlag] Image _imgFigure; [KUIFlag] Button _btnChallenge; #pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null #endregion #region Method /// /// /// public void InitView() { SetViewData(); _btnChallenge.onClick.AddListener(this.OnChallengeBtnClick); _btnClose.onClick.AddListener(this.OnCloseBtnClick); } /// /// /// public void RefreshView() { if (this.data is CityProxy.CityInfo cityInfo) { _tmpName.text = cityInfo.item.name; IconProxy.Instance.SetSprite(_imgFigure, cityInfo.item.icon); } } /// /// /// public void UpdateView() { } void OnCloseBtnClick() { CloseWindow(this); } void OnChallengeBtnClick() { if (this.data is CityProxy.CityInfo cityInfo) { LevelProxy.Instance.StartChallenge(cityInfo.item.levelId); } CloseWindow(this); } #endregion } }