43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System;
|
|
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":
|
|
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(itemInfo.triggerID, true) == 0)
|
|
{
|
|
isOn = !isOn;
|
|
tips.text = isOn ? "ÒÑ×°Åä" : "";
|
|
PacksackBagMgr.Instance.WearItemState(itemInfo, isOn);
|
|
TooRoomlMannger.Instance.Wear(itemInfo.toolName, isOn);
|
|
}
|
|
Debug.Log("IconBtn");
|
|
break;
|
|
case "UI_CheckMyselfItem":
|
|
Debug.Log("UI_CheckMyselfItem");
|
|
//TODO something
|
|
break;
|
|
}
|
|
}
|
|
} |