public void RecordNum(ResolveCardVo vo) { for (int i = 0; i < 4; i++) { if (vo.ResolveItem.ContainsKey(ids[i]) && _selectNumDic.ContainsKey(ids[i])) { //Debug.LogError(ids[i]); _selectNumDic[ids[i]] += vo.SelectedNum * vo.ResolveItem[ids[i]]; } } }
private void OnResolveBtn() { RepeatedField <UserCardSimplePB> list = new RepeatedField <UserCardSimplePB>(); bool isContanSRorSSR = false; for (int i = 0; i < _userCardList.Count; i++) { ResolveCardVo uc = _userCardList[i]; if (uc.SelectedNum > 0) { UserCardSimplePB pb = new UserCardSimplePB(); pb.CardId = uc.CardId; pb.Num = uc.SelectedNum; list.Add(pb); if (uc.Credit == CreditPB.Sr || uc.Credit == CreditPB.Ssr) { isContanSRorSSR = true; } } } if (list.Count == 0) { //Debug.LogError("没有选择卡牌!!!"); return; } if (isContanSRorSSR) { PopupManager.ShowConfirmWindow(I18NManager.Get("Card_EnsureResolveContainSRorSSrTips")).WindowActionCallback = evt => { if (evt == WindowEvent.Ok) { SendMessage(new Message(MessageConst.CMD_CARD_RESOLVE, list)); } }; } else { SendMessage(new Message(MessageConst.CMD_CARD_RESOLVE, list)); Debug.LogError("why twice?"); } }
public void SetData(ResolveCardVo vo) { _data = vo; transform.Find("NameText").GetComponent <Text>().text = vo.Name; SetNumText(); _cardQualityImage.sprite = AssetManager.Instance.GetSpriteAtlas(CardUtil.GetNewCreditSpritePath(vo.Credit)); //_cardQualityImage.SetNativeSize(); RawImage cardImage = transform.Find("Mask/CardImage").GetComponent <RawImage>(); Texture texture = ResourceManager.Load <Texture>(vo.CardPath, ModuleConfig.MODULE_CARD); if (texture == null) { Debug.LogError("NoCard" + vo.CardPath); texture = ResourceManager.Load <Texture>("Card/Image/MiddleCard/1000", ModuleConfig.MODULE_CARD); } cardImage.texture = texture; }
public int CompareTo(ResolveCardVo other) { int result = 0; if (other.Credit.CompareTo(Credit) != 0) { result = -other.Credit.CompareTo(Credit); } // else if (other.Evolution.CompareTo(Evolution) != 0) // { // result = other.Evolution.CompareTo(Evolution); // } // else if(other.Player.CompareTo(Player)!=0) // { // result = -other.Player.CompareTo(Player); // } else { result = -other.Num.CompareTo(Num); } return result; }