12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- 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;
- private void Init()
- {
- }
- public override void AddEvent()
- {
- }
- public override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- Btn_WidgetItem.onClick.AddListener(() =>
- {
- 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)
- {
- 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()
- {
- Icon_WenHao.gameObject.SetActive(true);
- icon.gameObject.SetActive(false);
- Text_Count.gameObject.SetActive(false);
- }
- public override void DormancyObj()
- {
- transform.RecoverColor();
- base.DormancyObj();
- }
- }
- }
|