1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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
- public Text Text;
- public Button BoxButton;
- public Transform Transform;
- public CloseItem CloseItem;
- #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>();
- Text = childDictionary[FashionShowCloseItemLabel.Text].GetComponent<Text>();
- Transform = fashionShowCloseItem;
- LanguageManager.Add(Text, new MulLanStr(LanguageLabel.UI__Pg_Bought));
- CloseItem = PlayerManager.CloseItemDictionary[closeID];
- CloseItem.SetupStandardItem(Icon1, Icon2, Icon3, BuyButton, BuyButtonText);
- BuyButton.SetActive(false);
- if (CloseItem.IsBought)
- {
- BoxButton.interactable = false;
- Text.SetActive(true);
- }
- else
- {
- BoxButton.interactable = true;
- }
- BoxButton.onClick.AddListener(() => CloseItem.OpenBuyPanel(() => FashionShowEditPage.UpdateTotalCost(true), null));
- }
- }
|