public void RefreshBuyPopUp(int id, StoreCostCurrecyType type) { if (type == StoreCostCurrecyType.OnlyRuneDebris || type == StoreCostCurrecyType.OnlySkinDebris || type == StoreCostCurrecyType.OnlyUnitDebris) { titleText.text = "兑换"; nameText.text = controller.GetDebrisItemName(id); contentText.text = controller.GetDebrisItemDescribe(id); propText.text = ""; frameImage1.gameObject.SetActive(true); frameImage2.gameObject.SetActive(false); LoadAtlasSprite(controller.GetDebrisItemIcon(id), iconImage_b); } else { titleText.text = "购买"; nameText.text = controller.GetStoreItemName(id); contentText.text = controller.GetStoreItemDescribe(id); propText.text = controller.GetStoreItemProp(id); bool isRune = controller.GetStoreItemType(id) == 3; frameImage1.gameObject.SetActive(!isRune); frameImage2.gameObject.SetActive(isRune); LoadAtlasSprite(controller.GetStoreItemIcon(id), iconImage_b); } RefreshCostText(id, type); }
private void RefreshCostText(int id, StoreCostCurrecyType type) { if (currentCostType == StoreCostCurrecyType.OnlyRuneDebris || currentCostType == StoreCostCurrecyType.OnlySkinDebris || currentCostType == StoreCostCurrecyType.OnlyUnitDebris) { leftCostText.text = (controller.GetDebrisItemPrice(id) * currentCount).ToString(); rightCostText.text = "取消"; return; } if (currentCount == 0) { leftButton.interactable = false; rightButton.interactable = (type != StoreCostCurrecyType.GoldAndDiamonds && type != StoreCostCurrecyType.GoldAndEmber); } else { leftButton.interactable = true; rightButton.interactable = true; } bool isAlone = (type != StoreCostCurrecyType.GoldAndDiamonds && type != StoreCostCurrecyType.GoldAndEmber); leftCostText.text = (controller.GetStoreItemCostLeft(id) * currentCount).ToString(); rightCostText.text = isAlone ? "取消" : (controller.GetStoreItemCostRight(id) * currentCount).ToString(); }
private void OnClickBuyButtonCallBack(int itemIndex) { int id = controller.GetItemId(itemIndex); currentCostType = controller.GetItemCostCurrencyType(currentItemType, itemIndex); UIManager.Instance.GetUIByType(UIType.StorePopUpUI, (ViewBase ui, System.Object param) => { (ui as StorePopUpView).EnterStoreBuyPopUpUI(id, currentCostType); }); }
private void SetBuyPopUpUI(StoreCostCurrecyType type) { leftEmberIcon.gameObject.SetActive(false); leftGoldIcon.gameObject.SetActive(false); leftDiamondIcon.gameObject.SetActive(false); leftDebrisRuneIcon.gameObject.SetActive(false); leftDebrisSkinIcon.gameObject.SetActive(false); leftDebrisUnitIcon.gameObject.SetActive(false); rightEmberIcon.gameObject.SetActive(false); rightGoldIcon.gameObject.SetActive(false); rightDiamondIcon.gameObject.SetActive(false); switch (type) { case StoreCostCurrecyType.OnlyEmber: leftEmberIcon.gameObject.SetActive(true); break; case StoreCostCurrecyType.OnlyDiamonds: leftDiamondIcon.gameObject.SetActive(true); break; case StoreCostCurrecyType.OnlyGold: leftGoldIcon.gameObject.SetActive(true); break; case StoreCostCurrecyType.OnlySkinDebris: leftDebrisSkinIcon.gameObject.SetActive(true); break; case StoreCostCurrecyType.GoldAndEmber: leftGoldIcon.gameObject.SetActive(true); rightEmberIcon.gameObject.SetActive(true); break; case StoreCostCurrecyType.GoldAndDiamonds: leftGoldIcon.gameObject.SetActive(true); rightDiamondIcon.gameObject.SetActive(true); break; case StoreCostCurrecyType.OnlyUnitDebris: leftDebrisUnitIcon.gameObject.SetActive(true); break; case StoreCostCurrecyType.OnlyRuneDebris: leftDebrisRuneIcon.gameObject.SetActive(true); break; } }
public void EnterStoreBuyPopUpUI(int id, StoreCostCurrecyType type) { OnEnter(); buyTran.gameObject.SetActive(true); giveTran.gameObject.SetActive(false); currentId = id; currentCostType = type; currentCount = 1; inputText.text = 1.ToString(); SetBuyPopUpUI(type); RefreshBuyPopUp(id, type); }