示例#1
0
 public void ShowPoker(int cardVal, int index)
 {
     Poker.SetCardId(cardVal);
     Poker.SetCardFront();
     Poker.SetCardDepth(index * 2);
     Poker.transform.localPosition = Vector3.zero;
 }
示例#2
0
        /// <summary>
        /// 发一张牌,无过程
        /// </summary>
        /// <param name="to"></param>
        /// <param name="cardValue"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        private PokerCard DealOnes(Transform to, int cardValue = 0, int index = 0)
        {
            GameObject gob = Instantiate(PokerPrefab);

            gob.transform.parent        = to;
            gob.transform.localScale    = Vector3.one * 0.76f;
            gob.transform.localScale   *= 1 / to.localScale.x;
            gob.transform.localPosition = Vector3.zero;
            PokerCard pCard = gob.GetComponent <PokerCard>();

            pCard.SetCardDepth(100 + index * 2);
            pCard.SetCardId(cardValue);
            pCard.SetCardFront();

            App.GetGameManager <DuifenGameManager>().PublicPokers.Add(pCard);
            return(pCard);
        }
示例#3
0
        private void DoBigDeal()
        {
            var        gdata     = App.GetGameData <GangwuGameData>();
            PokerInfo  pokerInfo = _showPokersInfo.Dequeue();
            Transform  toPos     = gdata.GetPlayer <PlayerPanel>(pokerInfo.Seat, true).PokersTrans[pokerInfo.PokerCount];
            GameObject dealPoker = DealOnes(BigBirth, toPos, pokerInfo.PokerValue, pokerInfo.PokerCount);

            //显示牌正面
            PokerCard pokerCard = dealPoker.GetComponent <PokerCard>();

            pokerCard.SetCardFront();

            //将牌放入公共牌堆,方便管理
            App.GetGameManager <GangWuGameManager>().PublicPokers.Add(pokerCard);

            Facade.Instance <MusicManager>().Play("dealer");
        }
示例#4
0
        /// <summary>
        /// 发一张牌,无过程
        /// </summary>
        /// <param name="to"></param>
        /// <param name="cardValue"></param>
        /// <param name="depth"></param>
        /// <returns></returns>
        protected virtual void DealOnes(Transform to, int cardValue = 0, int depth = 0)
        {
            GameObject gob = Instantiate(PokerPrefab);

            gob.transform.parent        = to;
            gob.transform.localScale    = Vector3.one;
            gob.transform.localScale   *= 1 / to.localScale.x;
            gob.transform.localPosition = Vector3.zero;
            PokerCard pCard = gob.GetComponent <PokerCard>();

            pCard.SetCardDepth(100 + depth * 2);
            pCard.SetCardId(cardValue);
            pCard.SetCardFront();
            if (PublicCardId > 0)
            {
                pCard.SetPublicMarkActive(PublicCardId == cardValue);
            }
            App.GetGameManager <FillpitGameManager>().PublicPokers.Add(pCard);
        }
示例#5
0
        /// <summary>
        /// 港式五张的结算方法
        /// </summary>
        public void DoResult(ISFSObject data)
        {
            var gdata = App.GetGameData <GangwuGameData>();

            ISFSArray        isfsArr = data.GetSFSArray("result");
            List <Transform> wheres  = new List <Transform>();

            foreach (ISFSObject isfsObj in isfsArr)
            {
                int         win   = isfsObj.GetInt("win");
                int         seat  = isfsObj.GetInt("seat");
                PlayerPanel panel = gdata.GetPlayer <PlayerPanel>(seat, true);

                //标记赢家的位置信息
                if (panel.Info != null)
                {
                    panel.Coin = isfsObj.GetLong("ttgold");
                    panel.RefreshPanel();
                }

                if (panel.PokersTrans[0].childCount > 0)
                {
                    int[]     cards = isfsObj.GetIntArray("cards");
                    PokerCard poker = panel.PokersTrans[0].GetChild(0).GetComponent <PokerCard>();

                    poker.SetCardId(cards[0]);
                    poker.SetCardFront();
                }

                if (win > 0)
                {
                    var resultSeat = seat;
                    var pokerType  = panel.UserBetPoker.PokerType;
                    if (panel.PokersTrans[panel.PokersTrans.Length - 1].childCount > 0)
                    {
                        pokerType.spriteName = "ct_" + isfsObj.GetUtfString("cardsName");
                        pokerType.MakePixelPerfect();
                        pokerType.transform.localScale = resultSeat == gdata.SelfSeat ? Vector3.one : new Vector3(1.5f, 1.5f, 1.5f);
                        pokerType.gameObject.SetActive(true);
                    }
                    panel.WinEffect.SetActive(true);

                    //如果是特殊牌型,需要播放牌型特效
                    if (EffectsMgr.NeedShowEffect(isfsObj.GetUtfString("cardsName")))
                    {
                        EffectsMgr.PlayParticleEffect("ct_" + isfsObj.GetUtfString("cardsName"), 2f, true);
                    }

                    if (resultSeat == gdata.SelfSeat)
                    {
                        Facade.Instance <MusicManager>().Play("win");
                        EffectsMgr.PlayYouWin();
                    }

                    wheres.Add(panel.UserIcon.transform);
                }
            }
            if (wheres.Count > 0)
            {
                BetMgr.BigBetStack.SendBetToSomewhere(wheres);
            }
        }