// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2021-04-22 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** namespace G.UI { using TMPro; using UnityEngine; using UnityEngine.UI; /// /// /// partial class GetKungfuBox { #region Field #pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null [KUIFlag] Button _btnConfirm; [KUIFlag] Image _imgIcon; [KUIFlag] TextMeshProUGUI _tmpName; #pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null #endregion #region Method /// /// /// public void InitView() { SetViewData(); _btnConfirm.onClick.AddListener(this.OnConfirmBtnClick); } /// /// /// public void RefreshView() { if (this.data is ItemProp prop) { var moves = ItemProxy.Instance.GetStaticItem(prop.use[0]); IconProxy.Instance.SetSprite(_imgIcon, moves.icon); _tmpName.text = moves.name; } } /// /// /// public void UpdateView() { } private void OnConfirmBtnClick() { CloseWindow(this); SoundProxy.PlayFxAsync(GlobalDefine.BUTTON_CLICK_SOUND); } #endregion } }