Exemplo n.º 1
0
 public void ShowPoker(int cardVal, int index)
 {
     Poker.SetCardId(cardVal);
     Poker.SetCardFront();
     Poker.SetCardDepth(index * 2);
     Poker.transform.localPosition = Vector3.zero;
 }
Exemplo n.º 2
0
        /// <summary>
        /// 发一张牌 有过程
        /// </summary>
        protected override GameObject DealOnes(Transform from, Transform to, int cardValue = 0, bool isBig = false, int index = 0)
        {
            GameObject gob     = Instantiate(PokerPrefab);
            var        gobTran = gob.transform;

            gobTran.parent        = from;
            gobTran.localPosition = Vector3.zero;
            gobTran.parent        = to;
            gobTran.localScale    = isBig ? Vector3.one * SelfCardScale : Vector3.one;
            var betPoker = gobTran.GetComponentInParent <BetPoker>();

            betPoker.MoveCards(index);

            PokerCard pCard = gob.GetComponent <PokerCard>();

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

            var comp = gob.GetComponent <TweenPosition>();

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

            comp.onFinished.Add(new EventDelegate
                                    (() =>
            {
                pCard.TurnCard();
            }));

            return(gob);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }