YanCheng_Metrology/Assets/Scripts/Project/UI/UI_Item/UI_CheckMyselfItem.cs

42 lines
1.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class UI_CheckMyselfItem : BaseItem
{
private string[] validToolNames = { "国网安全帽", "绝缘手套", "绝缘靴", "工作服" };
private ItemInfo itemInfo;
public void Init(ItemInfo _itemInfo, int count)
{
itemInfo = _itemInfo;
GetControl<TextMeshProUGUI>("CountText").text = count.ToString();
}
protected override void OnClick(string btnName)
{
base.OnClick(btnName);
switch (btnName)
{
case "ItemCloseBtn":
if (GameManager.RunModelMgr.ModeType != E_ModeType.Study)
{
int count = 0;
if (!GameManager.PacksackBagMgr.RemoveOneToolOrMater(itemInfo, ref count))
{
itemInfo.selfObj.SetActive(true);
Destroy(gameObject);
}
else
{
GetControl<TextMeshProUGUI>("CountText").text = count.ToString();
}
}
break;
case "UI_CheckMyselfItem":
//TODO something
break;
}
}
}