61 lines
1.5 KiB
C#
61 lines
1.5 KiB
C#
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using Games.Item;
|
|||
|
using GCGame.Table;
|
|||
|
using Module.Log;
|
|||
|
using GCGame;
|
|||
|
|
|||
|
public class EquipGemLvUpPackPanel : UIControllerBase<EquipGemLvUpPackPanel>
|
|||
|
{
|
|||
|
void OnEnable()
|
|||
|
{
|
|||
|
SetInstance(this);
|
|||
|
|
|||
|
UpdateBackPackItems();
|
|||
|
}
|
|||
|
|
|||
|
void OnDisable()
|
|||
|
{
|
|||
|
SetInstance(null);
|
|||
|
}
|
|||
|
|
|||
|
#region gem
|
|||
|
|
|||
|
public UIContainerSelect _ItemsContainer;
|
|||
|
|
|||
|
public void UpdateBackPackItems()
|
|||
|
{
|
|||
|
GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;
|
|||
|
//List<GameItem> itemlist = ItemTool.ItemFilter(BackPack, 0);
|
|||
|
List<GameItem> itemlist = BackPack.Items;
|
|||
|
List<GameItem> showItems = new List<GameItem>();
|
|||
|
|
|||
|
// 背包中存在存在三种状态的装备栏,他们的数量如下
|
|||
|
// 有装备的,开了的,还锁着的
|
|||
|
for (int nIndex = 0; nIndex < itemlist.Count; ++nIndex)
|
|||
|
{
|
|||
|
if (itemlist[nIndex].IsValid() && itemlist[nIndex].IsGem())
|
|||
|
{
|
|||
|
showItems.Add(itemlist[nIndex]);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
_ItemsContainer.InitSelectContent(showItems, null, ItemClick);
|
|||
|
}
|
|||
|
|
|||
|
public void ItemClick(object obj)
|
|||
|
{
|
|||
|
GameItem gemItem = obj as GameItem;
|
|||
|
|
|||
|
if (gemItem != null && gemItem.IsValid())
|
|||
|
{
|
|||
|
ItemTooltipsLogic.ShowItemTooltip(gemItem, ItemTooltipsLogic.ShowType.Info, transform.position);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|