示例#1
0
        public static CardFiveStarHand CreateHand(int size, int index, Transform parenTransform)
        {
            CardFiveStarHand cardFiveStarHand = Create <CardFiveStarHand>(CardFiveStarCardType.CardFiveStarHand, size, parenTransform);

            cardFiveStarHand.iHandIndex = index;
            return(cardFiveStarHand);
        }
 //向服务器请求出牌
 public bool RequestPlayCard(CardFiveStarHand hand)
 {
     if (!_IsCanChuCard)                                                       //当前可以出牌就发送出牌请求
     {
         return(false);                                                        //不可以出牌 就直接返回
     }
     EndDetecionMousePlayCard();                                               //结束鼠标位置检测 出牌
     if (!CardFiveStarRoom.Ins.GetUserPlayerInfo().IsLiangDao)                 //如果自己 亮倒 就只能出 摸的牌 不用检测
     {
         if (CardFiveStarRoom.Ins._LiangDaoCanHuCards.Contains(hand.CardSize)) //如果 出的牌是 炮牌 要判断一下
         {
             bool isAllPaoCard = true;
             for (int i = 0; i < _NewestHands.Count; i++)//遍历手牌 只要有一张 不是放炮的牌 就不可出炮牌
             {
                 if (!CardFiveStarRoom.Ins._LiangDaoCanHuCards.Contains(_NewestHands[i]))
                 {
                     isAllPaoCard = false;
                     break;
                 }
             }
             if (!isAllPaoCard)
             {
                 UIComponent.GetUiView <NormalHintPanelComponent>().ShowHintPanel("不能打放炮的牌");
                 //DOTO 加个提示等待操作的时候
                 return(false);
             }
         }
     }
     //发送出牌请求
     SessionComponent.Instance.Send(new Actor_FiveStar_PlayCardResult()
     {
         Card = hand.CardSize
     });
     UpChuCardHand = hand;
     //发送亮倒请求
     if (_isSelectLiang)
     {
         SessionComponent.Instance.Send(new Actor_FiveStar_LiangDao());
     }
     return(true);
 }
        public CardFiveStarHand _partyChuHand; //预选出牌手牌
        //选择出牌
        public void PointerDownHand(CardFiveStarHand clickHand)
        {
            CardFiveStarSoundMgr.Ins.PlaySound(SexType.None, FiveStarOperateType.ClickCard);//点牌 音效
            if (_partyChuHand == clickHand)
            {
                if (_IsCanChuCard)                  //当前可以出牌就发送出牌请求
                {
                    RequestPlayCard(_partyChuHand); //向服务器请求出牌
                }
            }
            else
            {
                CancelPartyHand();//取消之前的预选牌

                _partyChuHand = clickHand;
                //开启检测鼠标位置出牌
                StartDetecionMousePlayCard();
                //牌弹起
                _partyChuHand.SetPitchStatu(true);
            }
        }