コード例 #1
0
    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();
    }
コード例 #2
0
    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();
    }