Esempio n. 1
0
        /// <summary>
        /// 座位弃牌
        /// </summary>
        public void OnSeatDiscardPoker()
        {
            //找到手牌
            List <MaJiangCtrl_JuYou> handPokerList = MahJongManager_JuYou.Instance.GetHand(m_nSeatIndex);

            if (handPokerList == null)
            {
                return;
            }
            int handPokerListCount = handPokerList.Count;

            List <MaJiangCtrl_JuYou> TablePokerList = MahJongManager_JuYou.Instance.GetDicTable(m_nSeatIndex);

            //if (TablePokerList != null && TablePokerList.Count >= 16) Debug.Log("弃掉桌面牌" + m_nSeatIndex+ "TablePokerList.Count"+ TablePokerList.Count);
            if (TablePokerList != null && TablePokerList.Count >= 16)
            {
                MahJongManager_JuYou.Instance.ClearDicTable(m_nSeatIndex);
            }

            for (int i = 0; i < handPokerListCount; i++)
            {
                AppDebug.Log(string.Format("座位Index{0}弃牌{1}", m_nSeatIndex, handPokerList[0].Poker.ToChinese()));
                MaJiangCtrl_JuYou majiang = MahJongManager_JuYou.Instance.ClearHandPoker(m_nSeatIndex, handPokerList[0].Poker);

                if (majiang != null)
                {
                    majiang.gameObject.SetParent(m_DeskTopContainer.transform);
                    majiang.gameObject.layer        = m_DeskTopContainer.gameObject.layer;
                    majiang.transform.localPosition = m_DeskTopContainer.GetLocalPos(majiang.transform);
                }
            }

            //if (TablePokerList != null && TablePokerList.Count > 18) MahJongManager_JuYou.Instance.ClearDicTable(m_nSeatIndex);
        }
Esempio n. 2
0
        /// <summary>
        /// 开局发牌动画
        /// </summary>
        /// <param name="handPoker"></param>
        /// <returns></returns>
        private IEnumerator BeginAni(List <PokerCtrl> handPoker)
        {
            yield return(0);

            for (int i = handPoker.Count - 1; i >= 0; --i)
            {
                //Debug.Log("移动"+ m_UIHandPokerContainer.GetLocalPos(handPoker[i].transform).ToString() + handPoker[i].Poker.ToChinese());
                handPoker[i].gameObject.SetActive(true);

                handPoker[i].transform.DOLocalMove(m_UIHandPokerContainer.GetLocalPos(handPoker[handPoker.Count - 1 - i].transform), 0.3f, true);
                yield return(0);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 清空手牌
        /// </summary>
        public void ClearHandPoker()
        {
            //找到手牌
            List <MaJiangCtrl_PaiJiu> handPokerList = MahJongManager_PaiJiu.Instance.GetHand(m_nSeatPos);

            if (handPokerList == null)
            {
                return;
            }
            int handPokerListCount = handPokerList.Count;

            for (int i = 0; i < handPokerListCount; i++)
            {
                AppDebug.Log(string.Format("座位{0}弃牌{1}", m_nSeatPos, handPokerList[0].Poker.ToChinese()));

                MaJiangCtrl_PaiJiu majiang = MahJongManager_PaiJiu.Instance.ClearHandPoker(m_nSeatPos, handPokerList[0].Poker);

                majiang.gameObject.SetParent(m_DeskTopContainer.transform);
                majiang.gameObject.layer        = m_DeskTopContainer.gameObject.layer;
                majiang.transform.localPosition = m_DeskTopContainer.GetLocalPos(majiang.transform);
            }
        }