YanCheng_Metrology/Assets/Scripts/Project/UI/UI_Panel/UI_CheckMyselfPanel.cs

46 lines
1.3 KiB
C#

using System.Linq;
using UnityEngine;
using UnityEngine.UI;
public class UI_CheckMyselfPanel : BasePanel
{
private string[] validToolNames = { "国网安全帽", "绝缘手套", "绝缘靴", "工作服" };
public void Init()
{
}
public override void ShowMe()
{
var currentBagDataForTool = GameManager.PacksackBagMgr.GetItemsByE_TMDType(E_ToolOrDeviceOrMaterials.Tool);
var _content = GetControl<ScrollRect>("itemScrollView").content;
foreach (var item in currentBagDataForTool.Keys)
{
if (validToolNames.Contains(item.toolName))
{
var uiItem =
GameManager.ResourcesMgr.Load<GameObject>(Const.UI_Item + "UI_CheckMyselfPanel/UI_CheckMyselfItem");
uiItem.transform.parent = _content;
uiItem.GetComponent<UI_CheckMyselfItem>().Init(item,currentBagDataForTool[item].Count);
}
}
}
public override void HideMe()
{
}
protected override void OnClick(string btnName)
{
switch (btnName)
{
case "closeBtn":
UIManager.Instance.HidePanel<UI_CheckMyselfPanel>();
//GameManager.UIMgr.HidePanel<UI_CheckMyselfPanel>();
break;
default:
break;
}
}
}