public void AddHeroCard(VisitBattleUserCardVo vo) { for (int i = 0; i < 6; i++) { VisitMiddleHeroCard card = _middleCards.GetChild(i).GetComponent <VisitMiddleHeroCard>(); if (card.GetData() == null) { card.SetData(vo); break; } } _smallCardList.RefreshCells(); _cards.Add(vo); CountPoints(); }
public void RemoveCard(VisitBattleUserCardVo vo) { for (int i = 0; i < 6; i++) { VisitMiddleHeroCard card = _middleCards.GetChild(i).GetComponent <VisitMiddleHeroCard>(); if (card.GetData().UserCardVo.CardId == vo.UserCardVo.CardId) { card.SetData(null); card.transform.SetAsLastSibling(); break; } } ResetMiddleHeroCard(); _smallCardList.RefreshCells(); _cards.Remove(vo); CountPoints(); }