2025-05-18 01:04:31 +08:00

78 lines
1.5 KiB
C#

// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2022-01-14
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "PropListBox.View" company="Kunpo"></copyright>
// <summary></summary>
// ***********************************************************************
namespace G.UI
{
using UnityEngine;
using UnityEngine.UI;
/// <summary>
///
/// </summary>
partial class PropListBox
{
#region Auto Generate
#pragma warning disable CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
[KUIFlag]
KUIList __listRewards;
[KUIFlag]
Button _btnClose;
#pragma warning restore CS0649 // 从未对字段赋值,字段将一直保持其默认值 null
#endregion
#region Field
#endregion
#region Method
/// <summary>
///
/// </summary>
public void InitView()
{
SetViewData();
__listRewards.AddTemplate<PropWidget>(true);
_btnClose.onClick.AddListener(this.OnCloseBtnClick);
}
/// <summary>
///
/// </summary>
public void RefreshView()
{
if (this.data is Item.ItemInfo[] items)
{
int count = 9;
__listRewards.Clear();
foreach (var item in items)
{
if (--count < 0)
break;
__listRewards.GetItem<PropWidget>().SetItem(item);
}
}
}
/// <summary>
///
/// </summary>
public void OnCloseBtnClick()
{
CloseWindow(this);
}
#endregion
}
}