private void GenerateNewShopItem(ShopItem si) { LevelPropertyForm_ShopItem row_si = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.LevelPropertyForm_ShopItem].AllocateGameObject <LevelPropertyForm_ShopItem>(ShopItemContainer); row_si.Initialize(si, onEditButtonClick: delegate { CurEdit_ShopItem = row_si; switch (si) { case ShopItem_Card sic: { ConfirmPanel cp = UIManager.Instance.ShowUIForms <ConfirmPanel>(); cp.Initialize( descText: LanguageManager.Instance.GetText("LevelEditorPanel_SetCardPrice"), leftButtonClick: delegate { if (int.TryParse(cp.InputText1, out int cardRareLevel)) { if (int.TryParse(cp.InputText2, out int probability)) { cp.CloseUIForm(); sic.CardRareLevel = cardRareLevel; sic.Probability = probability; Refresh(); StartCoroutine(ClientUtils.UpdateLayout((RectTransform)ShopItemContainer)); } else { NoticeManager.Instance.ShowInfoPanelCenter(LanguageManager.Instance.GetText("Notice_LevelEditorPanel_PleaseInputInteger"), 0f, 1f); } } else { NoticeManager.Instance.ShowInfoPanelCenter(LanguageManager.Instance.GetText("Notice_LevelEditorPanel_PleaseInputInteger"), 0f, 1f); } }, rightButtonClick: delegate { cp.CloseUIForm(); }, leftButtonText: LanguageManager.Instance.GetText("Common_Confirm"), rightButtonText: LanguageManager.Instance.GetText("Common_Cancel"), inputFieldPlaceHolderText1: LanguageManager.Instance.GetText("LevelEditorPanel_CardRareLevelPlaceHolder"), inputFieldPlaceHolderText2: LanguageManager.Instance.GetText("LevelEditorPanel_ProbabilityPlaceHolder") ); break; }
public void Refresh() { Clear(); if (CurEdit_ShopItem != null) { CurEdit_ShopItem.IsEdit = false; CurEdit_ShopItem = null; } foreach (ShopItem si in Cur_ShopItems) { GenerateNewShopItem(si); } UIManager.Instance.GetBaseUIForm <LevelEditorPanel>().StartCoroutine(Co_refresh); }