76 lines
1.6 KiB
C#
Raw Permalink Normal View History

2025-05-18 01:04:31 +08:00
// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2021-04-22
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "GetKungfuBox.View" company="Kunpo"></copyright>
// <summary></summary>
// ***********************************************************************
namespace G.UI
{
using TMPro;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
///
/// </summary>
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
/// <summary>
///
/// </summary>
public void InitView()
{
SetViewData();
_btnConfirm.onClick.AddListener(this.OnConfirmBtnClick);
}
/// <summary>
///
/// </summary>
public void RefreshView()
{
if (this.data is ItemProp prop)
{
var moves = ItemProxy.Instance.GetStaticItem<ItemMoves>(prop.use[0]);
IconProxy.Instance.SetSprite(_imgIcon, moves.icon);
_tmpName.text = moves.name;
}
}
/// <summary>
///
/// </summary>
public void UpdateView()
{
}
private void OnConfirmBtnClick()
{
CloseWindow(this);
SoundProxy.PlayFxAsync(GlobalDefine.BUTTON_CLICK_SOUND);
}
#endregion
}
}