public void RefreshBagView(Data.BagType type, int index) { itemNameText.text = controller.GetPlayerBagItemName(type, index); itemCountText.text = "<color=#d5d5d5>拥有:</color> " + controller.GetPlayerBagItemCount(type, index); itemIntroduceText.text = controller.GetPlayerBagItemDescribe(type, index); itemPriceText.text = controller.GetPlayerBagItemPrice(type, index).ToString(); int icon = controller.GetPlayerBagItemIcon(type, index); if (icon != 0) { GameResourceLoadManager.GetInstance().LoadAtlasSprite(icon, delegate(string name, AtlasSprite atlasSprite, System.Object param) { itemIcon.SetSprite(atlasSprite); }, true); } bool canShell = controller.GetPlayerBagItemIsShell(type, index) == 1; sellButton.interactable = canShell; itemSellText.gameObject.SetActive(canShell); goldImage.gameObject.SetActive(canShell); itemNotSellText.gameObject.SetActive(!canShell); itemPriceText.gameObject.SetActive(canShell); bool notUse = controller.GetPlayerBagItemUseType(type, index) == 0; useButton.gameObject.SetActive(!notUse); useText.gameObject.SetActive(!notUse); bool isRune = controller.IsRune(type, index); itemFrameImage1.gameObject.SetActive(!isRune); itemFrameImage2.gameObject.SetActive(isRune); }
private void OnClickUseButton() { Data.BagType type = controller.GetPlayerBagItemType(currentBagType, currentItemIndex); if (type == Data.BagType.RuneBag) { UIManager.Instance.GetUIByType(UIType.RuneMainUI, (ViewBase ui, System.Object param) => { ui.OnEnter(); }); UIManager.Instance.GetUIByType(UIType.MainLeftBar, (ViewBase ui, System.Object param) => { (ui as MainLeftBarView).SetRuneClick(); }); } else if (type == Data.BagType.DebrisBag) { UIManager.Instance.GetUIByType(UIType.StoreScreen, (ViewBase ui, System.Object param) => { ui.OnEnter(); }); UIManager.Instance.GetUIByType(UIType.MainLeftBar, (ViewBase ui, System.Object param) => { (ui as MainLeftBarView).SetLeftBarNoClick(); }); } else { if (controller.IsLoudspeaker(currentBagType, currentItemIndex)) { MessageDispatcher.PostMessage(Constants.MessageType.OpenLoudspeakerView); } else { currentSelectType = 1; OpenPopUp(); } } }
private void OnClickRuneToggle(bool isOn) { runeToggle.interactable = !isOn; if (!isOn) { return; } SetTextToGray(); runeText.color = Color.white; currentBagType = Data.BagType.RuneBag; }
private void OnClickDebrisToggle(bool isOn) { debrisToggle.interactable = !isOn; if (!isOn) { return; } SetTextToGray(); debrisText.color = Color.white; currentBagType = Data.BagType.DebrisBag; }
private void OnClickCardToggle(bool isOn) { cardToggle.interactable = !isOn; if (!isOn) { return; } SetTextToGray(); cardText.color = Color.white; currentBagType = Data.BagType.ComplexBag; }
private void OnClickComfirm_pButton() { Data.BagType type = controller.GetPlayerBagItemType(currentBagType, currentItemIndex); long itemId = controller.GetPlayerBagItemId(currentBagType, currentItemIndex); if (currentSelectType == 2) //Sell { controller.SendSellItem(type, currentCount_p, itemId); } else if (currentSelectType == 1) //Use { controller.SendUseItem(type, currentCount_p, itemId); } OnClickClose_pButton(); RefreshBagView(currentBagType, 0); }