public void Initialize(UI_BoxOpenPopup.COST_TYPE type) { gameObject.SetActive(true); this.type = type; switch (type) { case UI_BoxOpenPopup.COST_TYPE.KEY: break; case UI_BoxOpenPopup.COST_TYPE.GOLD: text_Message.text = string.Format(LocalizationManager.GetLangDesc("Shop_Needgoodsmessage"), LocalizationManager.GetLangDesc("Gamemoney_Gold")); break; case UI_BoxOpenPopup.COST_TYPE.DIAMOND: text_Message.text = string.Format(LocalizationManager.GetLangDesc("Shop_Needgoodsmessage"), LocalizationManager.GetLangDesc("Gamemoney_Diamond")); break; } LayoutRebuilder.ForceRebuildLayoutImmediate(text_Message.rectTransform); LayoutRebuilder.ForceRebuildLayoutImmediate((RectTransform)text_Message.rectTransform.parent); LayoutRebuilder.ForceRebuildLayoutImmediate((RectTransform)text_Message.rectTransform.parent.parent); LayoutRebuilder.ForceRebuildLayoutImmediate((RectTransform)text_Message.rectTransform.parent.parent.parent); }
public void Click_BoxOpen(int id, UI_BoxOpenPopup.COST_TYPE costType, int cost) { boxOpenPopup.gameObject.SetActive(true); boxOpenPopup.Initialize(id, costType, cost); }