83 lines
1.9 KiB
C#
83 lines
1.9 KiB
C#
// ***********************************************************************
|
|
// Assembly : Game
|
|
// Author : Kimch
|
|
// Created : 2020-12-16
|
|
// Description :
|
|
// Last Modified By :
|
|
// Last Modified On :
|
|
// ***********************************************************************
|
|
// <copyright file= "ChaDetailBox.View" company="Kunpo"></copyright>
|
|
// <summary></summary>
|
|
// ***********************************************************************
|
|
namespace G.UI
|
|
{
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
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
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public void InitView()
|
|
{
|
|
SetViewData();
|
|
_attributes.AddTemplate<EquipmentAttributeItem>(true);
|
|
_attributes2.AddTemplate<EquipmentAttributeItem>(true);
|
|
_btnBlack.onClick.AddListener(this.OnCloseBtnClick);
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public void RefreshView()
|
|
{
|
|
_attributes.Clear();
|
|
_attributes2.Clear();
|
|
var attrItems = ItemProxy.Instance.GetStaticItems<ItemAttribute>(); ;
|
|
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());
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public void UpdateView()
|
|
{
|
|
}
|
|
|
|
private void OnCloseBtnClick()
|
|
{
|
|
CloseWindow(this);
|
|
SoundProxy.PlayFxAsync(GlobalDefine.BUTTON_CLICK_SOUND);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|