1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class FashionShowCloseItem
- {
- #region Config
- //StartMark-Used by LabelUtility-Do not remove
- private Image Icon1;
- private Image Icon2;
- private Image Icon3;
- private Button BuyButton;
- private TextPlus BuyButtonText;
- //EndMark-Used by LabelUtility-Do not remove
- private Button BoxButton;
- #endregion
- public void Init(int closeID, Transform fashionShowCloseItem)
- {
- Dictionary<string, Transform> childDictionary = new Dictionary<string, Transform>();
- Auxiliary.CompileDic(fashionShowCloseItem, childDictionary);
- Icon1 = childDictionary[FashionShowCloseItemLabel.Icon1].GetComponent<Image>();
- Icon2 = childDictionary[FashionShowCloseItemLabel.Icon2].GetComponent<Image>();
- Icon3 = childDictionary[FashionShowCloseItemLabel.Icon3].GetComponent<Image>();
- BuyButton = childDictionary[FashionShowCloseItemLabel.BuyButton].GetComponent<Button>();
- BoxButton = childDictionary[FashionShowCloseItemLabel.FashionShowCloseItem].GetComponent<Button>();
- BuyButtonText = childDictionary[FashionShowCloseItemLabel.BuyButtonText].GetComponent<TextPlus>();
- CloseItem closeItem = PlayerManager.CloseItemDictionary[closeID];
- closeItem.SetupStandardItem(Icon1, Icon2, Icon3, BuyButton, BuyButtonText);
- BuyButton.SetActive(false);
- BoxButton.interactable = !closeItem.IsBought;
- BoxButton.onClick.AddListener(() => closeItem.OpenBuyPanel(null));
- }
- }
|