123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using System;
- using Core.Language;
- using Fort23.UTool;
- using GameLogic.Bag;
- using GameLogic.Equipment;
- using GameLogic.Hero;
- using UnityEngine;
- using Utility;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "WidgetItem")]
- public partial class WidgetItem : ItemWidgetBasic
- {
- public ItemInfo itemInfo;
- public bool isClick = false;
- private void Init()
- {
- }
- public override void AddEvent()
- {
- }
- public override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- Btn_WidgetItem.onClick.AddListener(() =>
- {
- if(!isClick)
- return;
- if (itemInfo.config.associateID == 3)
- {
-
- GongFaDetailsPanel.Open(itemInfo);
- }
- else if (itemInfo.config.associateID == 4)
- {
-
- FaBaoDetailsPanel.OpenPanel(itemInfo);
- }
- else
- {
- ItemDetailsPanel.OpenPanel(itemInfo);
- }
- });
- base.AddButtonEvent();
- }
- public void InitWidget(ItemInfo itemInfo,bool isclick = true)
- {
- this.isClick = isclick;
- this.itemInfo = itemInfo;
- icon.gameObject.SetActive(true);
- icon.icon_name = itemInfo.config.icon;
- Icon_WenHao.gameObject.SetActive(false);
- if (itemInfo.count.Value > 0)
- {
- Text_Count.gameObject.SetActive(true);
- Text_Count.text = itemInfo.count.Value.ToStringEx();
- }
- else
- {
- Text_Count.gameObject.SetActive(false);
- }
- }
- public void ShowWenhao()
- {
- isClick = false;
- Icon_WenHao.gameObject.SetActive(true);
- icon.gameObject.SetActive(false);
- Text_Count.gameObject.SetActive(false);
- }
- public override void DormancyObj()
- {
- transform.RecoverColor();
- base.DormancyObj();
- }
- }
- }
|