// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2020-12-16
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
//
//
// ***********************************************************************
namespace G.UI
{
using UnityEngine;
using UnityEngine.UI;
///
///
///
partial class ChaDetailBox
{
#region Field
#pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
[KUIFlag]
Button _btnBlack;
[KUIFlag]
KUIList _attributes;
[KUIFlag]
KUIList _attributes2;
#pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
#endregion
#region Method
///
///
///
public void InitView()
{
SetViewData();
_attributes.AddTemplate(true);
_attributes2.AddTemplate(true);
_btnBlack.onClick.AddListener(this.OnCloseBtnClick);
}
///
///
///
public void RefreshView()
{
_attributes.Clear();
_attributes2.Clear();
var attrItems = ItemProxy.Instance.GetStaticItems(); ;
var attributes = PlayerProxy.Instance.combatAttributes;
for (int i = 0; i < attrItems.Count; i++)
{
if (attrItems[i].group == 1)
_attributes.GetItem().SetData(attributes[attrItems[i].id].ToString());
if (attrItems[i].group == 2)
_attributes2.GetItem().SetData(attributes[attrItems[i].id].ToString());
}
}
///
///
///
public void UpdateView()
{
}
private void OnCloseBtnClick()
{
CloseWindow(this);
SoundProxy.PlayFxAsync(GlobalDefine.BUTTON_CLICK_SOUND);
}
#endregion
}
}