예제 #1
0
    /// <summary>
    /// 玩家出牌调用
    /// </summary>
    private void OnPlayerPlayCard()
    {
        //不能直接出牌,需要判断
        List <Card> cardList = CharacterView.PlayerController.FindSelected();
        CardType    cardType;

        if (Ruler.CanPop(cardList, out cardType))
        {
            PlayCardArgs e = new PlayCardArgs()
            {
                CardType      = cardType,
                CharacterType = CharacterType.Player,
                Length        = cardList.Count,
                Weight        = Tools.GetWeight(cardList, cardType)
            };
            UnityEngine.Debug.Log(cardType.ToString());
            dispatcher.Dispatch(CommandEvent.PlayCard, e);
        }
        else
        {
            Debug.Log("牌不对!");
        }
    }