Exemplo n.º 1
0
        /// <summary>
        /// 小盲注的位置索引
        /// </summary>
        //private int _smallD = 0;

        #region     发手牌


        /// <summary>
        /// 发一张牌 有过程
        /// </summary>
        private GameObject DealOnes(Transform from, Transform to, int cardValue = 0, int index = 0)
        {
            GameObject gob = Instantiate(PokerPrefab);

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

            pCard.SetCardDepth(100 + index * 2);
            gob.transform.parent = to;
            gob.GetComponent <PokerCard>().SetCardId(cardValue);

            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.76f;
            ts.ResetToBeginning();
            ts.PlayForward();

            return(gob);
        }
Exemplo n.º 2
0
 public void ShowPoker(int cardVal, int index)
 {
     Poker.SetCardId(cardVal);
     Poker.SetCardFront();
     Poker.SetCardDepth(index * 2);
     Poker.transform.localPosition = Vector3.zero;
 }
Exemplo n.º 3
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.º 4
0
        /// <summary>
        /// 发一张牌 无过程
        /// </summary>
        private GameObject DealOnes(Transform to, int cardValue = 0, bool isBig = false, int index = 0)
        {
            GameObject gob = Instantiate(PokerPrefab);

            gob.transform.parent        = to;
            gob.transform.localScale    = isBig ? new Vector3(0.7f, 0.7f, 0.7f) : new Vector3(0.4f, 0.4f, 0.4f);
            gob.transform.localScale   *= 1 / to.localScale.x;
            gob.transform.localPosition = Vector3.zero;
            PokerCard pCard = gob.GetComponent <PokerCard>();

            pCard.SetCardDepth(100 + index * 2);
            gob.GetComponent <PokerCard>().SetCardId(cardValue);

            return(gob);
        }
Exemplo n.º 5
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.º 6
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.º 7
0
        /// <summary>
        /// 小盲注的位置索引
        /// </summary>
        //private int _smallD = 0;

        #region 发手牌

        /// <summary>
        /// 发一张牌 有过程
        /// </summary>
        private GameObject DealOnes(Transform from, Transform to, int cardValue = 0, int index = 0)
        {
            GameObject gob = Instantiate(PokerPrefab);

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

            pCard.SetCardDepth(100 + index * 2);
            gob.transform.parent     = to;
            gob.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
            gob.GetComponent <PokerCard>().SetCardId(cardValue);

            gob.GetComponent <TweenPosition>().duration = /*0.15f;/*/ 0.25f;//*/
            gob.GetComponent <TweenPosition>().from     = gob.transform.localPosition;
            gob.GetComponent <TweenPosition>().to       = Vector3.zero;
            gob.GetComponent <TweenPosition>().ResetToBeginning();
            gob.GetComponent <TweenPosition>().PlayForward();

            return(gob);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 发一张牌 有过程
        /// </summary>
        protected virtual GameObject DealOnes(Transform from, Transform to, int cardValue = 0, bool isBig = false, int index = 0)
        {
            GameObject gob = Instantiate(PokerPrefab);

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

            pCard.SetCardDepth(100 + index * 2);
            gob.transform.parent     = to;
            gob.transform.localScale = /*isBig ? Vector3.one * SelfCardScale :*/ Vector3.one;
            gob.GetComponent <PokerCard>().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();
            return(gob);
        }