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