Esempio n. 1
0
    private void OnSmallHeroCardClick(BattleUserCardVo vo)
    {
        int cardOpenNum = _model.CardOpenNum();

        if (_model.SelectedCount >= cardOpenNum)
        {
            if (vo.IsUsed == false)
            {
                FlowText.ShowMessage(I18NManager.Get("SupporterActivity_AtMost",
                                                     cardOpenNum)); // ("最多选择"+cardOpenNum+"个");
            }
            else
            {
                _model.SelectedCount--;
                vo.IsUsed = false;
                View.RemoveCard(vo);
            }
        }
        else if (_model.SelectedCount < cardOpenNum)
        {
            if (vo.IsUsed == false)
            {
                _model.SelectedCount++;
                vo.IsUsed = true;
                View.AddHeroCard(vo);
            }
            else
            {
                _model.SelectedCount--;
                vo.IsUsed = false;
                View.RemoveCard(vo);
            }
        }
    }