38 lines
1004 B
C#
38 lines
1004 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class UI_CheckMyselfItem : BaseItem
|
|
{
|
|
public ItemInfo itemInfo;
|
|
public TextMeshProUGUI tips;
|
|
public bool isOn = false;
|
|
public void Init(ItemInfo _itemInfo)
|
|
{
|
|
itemInfo = _itemInfo;
|
|
if(PacksackBagMgr.Instance.wearDic.ContainsKey(itemInfo.toolId))
|
|
{
|
|
isOn = true;
|
|
tips.text = isOn ? "ÒÑ×°Åä" : "";
|
|
}
|
|
}
|
|
|
|
protected override void OnClick(string btnName)
|
|
{
|
|
base.OnClick(btnName);
|
|
switch (btnName)
|
|
{
|
|
case "IconBtn":
|
|
isOn = !isOn;
|
|
tips.text = isOn ? "ÒÑ×°Åä" : "";
|
|
PacksackBagMgr.Instance.WearItemState(itemInfo, isOn);
|
|
Debug.Log("IconBtn");
|
|
break;
|
|
case "UI_CheckMyselfItem":
|
|
Debug.Log("UI_CheckMyselfItem");
|
|
//TODO something
|
|
break;
|
|
}
|
|
}
|
|
} |