123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using GameLogic.Bag;
- using GameLogic.Equipment;
- using UnityEngine;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "WidgetItem" )]
- public partial class WidgetItem : UIComponent
- {
- public ItemInfo itemInfo;
- private WidgetItemColorConfig colorConfig;
- private void Init()
- {
- colorConfig = btnClick.gameObject.GetComponent<WidgetItemColorConfig>();
- }
- public override void AddEvent()
- {
- }
- public override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- }
- public void InitWidget(ItemInfo itemInfo)
- {
- this.itemInfo = itemInfo;
- numObj.SetActive(false);
- alertRed.SetActive(false);
- icon.gameObject.SetActive(true);
-
- if (itemInfo.eqInfo != null)
- {
- icon.icon_name = HeroUITools.GetEquipmentIconName(itemInfo);
- bg.color = colorConfig.bgColors[itemInfo.eqInfo.quality];
- corner.color = colorConfig.cornerColors[itemInfo.eqInfo.quality];
- light.color = colorConfig.lightColors[itemInfo.eqInfo.quality];
- border.color = colorConfig.borderColors[itemInfo.eqInfo.quality];
- glow.color = colorConfig.glowColors[itemInfo.eqInfo.quality];
- }
- else
- {
- icon.icon_name = itemInfo.config.icon;
-
- // switch (itemInfo.eqInfo.quality)
- // {
- // case 1:
- // case 2:
- // bg.color = colorConfig.bgColors[1];
- // break;
- // }
-
- // bg.color = Color.blue;
- }
- // if (itemInfo.config.itemTyp == 4)
- // {
- // itemInfo.eqInfo = PlayerManager.Instance.eqController
- // .BuildEquipment(itemInfo.config, 1, 1);
- // //itemInfo.eqInfo.InitEquipment(itemInfo.config,1,1);
- // }
- }
- public void SetEmpty()
- {
- numObj.SetActive(false);
- icon.gameObject.SetActive(false);
- alertRed.SetActive(false);
- corner.gameObject.SetActive(false);
- glow.gameObject.SetActive(false);
- bg.color = colorConfig.bgColors[0];
- light.color = colorConfig.lightColors[0];
- border.color = colorConfig.borderColors[0];
- }
- }
- }
|