FashionShowCloseItem.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class FashionShowCloseItem
  6. {
  7. #region Config
  8. //StartMark-Used by LabelUtility-Do not remove
  9. private Image Icon1;
  10. private Image Icon2;
  11. private Image Icon3;
  12. private Button BuyButton;
  13. private TextPlus BuyButtonText;
  14. //EndMark-Used by LabelUtility-Do not remove
  15. private Button BoxButton;
  16. #endregion
  17. public void Init(int closeID, Transform fashionShowCloseItem)
  18. {
  19. Dictionary<string, Transform> childDictionary = new Dictionary<string, Transform>();
  20. Auxiliary.CompileDic(fashionShowCloseItem, childDictionary);
  21. Icon1 = childDictionary[FashionShowCloseItemLabel.Icon1].GetComponent<Image>();
  22. Icon2 = childDictionary[FashionShowCloseItemLabel.Icon2].GetComponent<Image>();
  23. Icon3 = childDictionary[FashionShowCloseItemLabel.Icon3].GetComponent<Image>();
  24. BuyButton = childDictionary[FashionShowCloseItemLabel.BuyButton].GetComponent<Button>();
  25. BoxButton = childDictionary[FashionShowCloseItemLabel.FashionShowCloseItem].GetComponent<Button>();
  26. BuyButtonText = childDictionary[FashionShowCloseItemLabel.BuyButtonText].GetComponent<TextPlus>();
  27. CloseItem closeItem = PlayerManager.CloseItemDictionary[closeID];
  28. closeItem.SetupStandardItem(Icon1, Icon2, Icon3, BuyButton, BuyButtonText);
  29. BuyButton.SetActive(false);
  30. BoxButton.interactable = !closeItem.IsBought;
  31. BoxButton.onClick.AddListener(() => closeItem.OpenBuyPanel(null));
  32. }
  33. }