示例#1
0
        /// <summary>
        /// 发一张牌 有过程
        /// </summary>
        private GameObject DealOnes(Transform from, Transform to, int cardValue = 0, bool isSelf = false, int index = 0)
        {
            GameObject gob = Instantiate(CardPrefab);

            gob.transform.parent        = from;
            gob.transform.localPosition = Vector3.zero;
            PaiJiuCard pCard = gob.GetComponent <PaiJiuCard>();

            pCard.SetCardDepth(100 + index * 2);
            gob.transform.parent = to;
            pCard.SetCardId(cardValue);
            pCard.SetCardFront();
            pCard.CardIndex = index;
            pCard.CardCouldClick(isSelf);

            TweenPosition tp = gob.GetComponent <TweenPosition>();

            tp.duration = 0.15f;//0.25f;
            tp.from     = gob.transform.localPosition;
            tp.to       = Vector3.zero;
            tp.ResetToBeginning();
            tp.PlayForward();

            TweenScale ts = gob.GetComponent <TweenScale>();

            ts.duration = 0.15f;
            ts.from     = Vector3.one * 0.3f;
            ts.to       = Vector3.one * 0.8f;
            ts.ResetToBeginning();
            ts.PlayForward();

            return(gob);
        }
示例#2
0
        /// <summary>
        /// 发一张牌,无过程
        /// </summary>
        /// <param name="to"></param>
        /// <param name="cardValue"></param>
        /// <param name="index"></param>
        /// <param name="isSelf"></param>
        /// <returns></returns>
        private PaiJiuCard DealOnes(Transform to, int cardValue = 0, int index = 0, bool isSelf = false)
        {
            GameObject gob = Instantiate(CardPrefab);

            gob.transform.parent        = to;
            gob.transform.localScale    = Vector3.one * 0.8f;
            gob.transform.localPosition = Vector3.zero;
            PaiJiuCard pCard = gob.GetComponent <PaiJiuCard>();

            pCard.SetCardDepth(100 + index * 2);
            pCard.CardIndex = index;
            pCard.SetCardId(cardValue);
            pCard.SetCardFront();
            pCard.CardCouldClick(isSelf);

            App.GetGameManager <PaiJiuGameManager>().PublicPokers.Add(pCard);
            return(pCard);
        }
示例#3
0
        /// <summary>
        /// 发出接受到的所有牌
        /// </summary>
        public void FastDeal()
        {
            if (_dealingCards.Count <= 0)
            {
                return;
            }
            int selfSeat = App.GameData.SelfSeat;

            var gdata = App.GetGameData <PaiJiuGameData>();

            int cardCount = _dealingCards.Count;

            for (int i = 0; i < cardCount; i++)
            {
                PaiJiuCardInfo pokerInfo = _dealingCards.Dequeue();

                PaiJiuPlayer panel = gdata.GetPlayer <PaiJiuPlayer>(pokerInfo.Seat, true);
                PaiJiuCard   card  = DealOnes(panel.PokersTrans[pokerInfo.CardIndex], pokerInfo.PokerVal, pokerInfo.CardIndex, pokerInfo.Seat == selfSeat);
                panel.AddPoker(card);
            }
        }
示例#4
0
        private void BigDeal()
        {
            var main  = App.GetGameManager <PaiJiuGameManager>();
            var gdata = App.GetGameData <PaiJiuGameData>();

            Debug.Log("===== dealcount == " + _dealCount + " , length = " + _dealingCards.Count + " ===== ");
            for (int i = 0; i < _dealCount; i++)
            {
                PaiJiuCardInfo pokerInfo    = _dealingCards.Dequeue();      //弹出要发的牌
                int            cardIndex    = pokerInfo.CardIndex;          //发到了第几张手牌
                int            cardSeat     = pokerInfo.Seat;               //发牌人座位号
                PaiJiuPlayer   paiJiuPlayer = gdata.GetPlayer <PaiJiuPlayer>(cardSeat, true);
                Transform      toPos        = paiJiuPlayer.PokersTrans[cardIndex % paiJiuPlayer.PokersTrans.Length];

                GameObject dealPoker = DealOnes(BigBirth, toPos, pokerInfo.PokerVal, cardSeat == App.GameData.SelfSeat, cardIndex);  //发牌
                PaiJiuCard pokerCard = dealPoker.GetComponent <PaiJiuCard>();
                pokerCard.SetCardFront();
                paiJiuPlayer.AddPoker(pokerCard);
                Facade.Instance <MusicManager>().Play("dealer");
                main.PublicPokers.Add(pokerCard);
            }
        }