Пример #1
0
 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);
     }
 }
Пример #2
0
    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();
    }
Пример #3
0
    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();
    }