WidgetItem.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using GameLogic.Bag;
  2. using GameLogic.Equipment;
  3. namespace Fort23.Mono
  4. {
  5. [UIBinding(prefab = "WidgetItem" )]
  6. public partial class WidgetItem : UIComponent
  7. {
  8. public ItemInfo itemInfo;
  9. private void Init()
  10. {
  11. }
  12. public override void AddEvent()
  13. {
  14. }
  15. public override void DelEvent()
  16. {
  17. }
  18. public override void AddButtonEvent()
  19. {
  20. }
  21. public void InitWidget(ItemInfo itemInfo)
  22. {
  23. this.itemInfo = itemInfo;
  24. numObj.SetActive(false);
  25. alertRed.SetActive(false);
  26. icon.gameObject.SetActive(true);
  27. if (itemInfo.eqInfo != null)
  28. {
  29. icon.icon_name = HeroUITools.GetEquipmentIconName(itemInfo);
  30. // bg.icon_name =
  31. }
  32. else
  33. {
  34. icon.icon_name = itemInfo.config.icon;
  35. }
  36. // if (itemInfo.config.itemTyp == 4)
  37. // {
  38. // itemInfo.eqInfo = PlayerManager.Instance.eqController
  39. // .BuildEquipment(itemInfo.config, 1, 1);
  40. // //itemInfo.eqInfo.InitEquipment(itemInfo.config,1,1);
  41. // }
  42. }
  43. public void SetEmpty()
  44. {
  45. numObj.SetActive(false);
  46. icon.gameObject.SetActive(false);
  47. alertRed.SetActive(false);
  48. }
  49. }
  50. }