Ejemplo n.º 1
0
        /// <summary>
        ///     胡牌
        /// </summary>
        /// <param name="huCards"></param>
        private void InitHuCards(List <int> huCards)
        {
            var lenth = huCards.Count;

            _huPile.transform.localPosition = new Vector3(nextPos, 0);
            for (var i = 0; i < lenth; i++)
            {
                var item = GameTools.CreateMahjong(huCards[i], false);
                item.GetComponent <MahjongItem>().SetHuTag();
                _huPile.AddItem(item, false);
            }
            _handPile.ResetPosition();
            nextPos += lenth * _handPile.Layout.Width;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 手牌
        /// </summary>
        /// <param name="handCards"></param>
        private void InitHandCards(List <int> handCards)
        {
            int lenth = handCards.Count;

            handCards = GameTools.SortCardWithLaiZiOppset(handCards, App.GetGameManager <Mahjong2DGameManager>().LaiZiNum).ToList();
            _handPile.transform.localPosition = new Vector3(nextPos, 0);
            for (int i = 0; i < lenth; i++)
            {
                Transform item = GameTools.CreateMahjong(handCards[i], false);
                item.GetComponent <MahjongItem>().JudgeHunTag(App.GetGameManager <Mahjong2DGameManager>().LaiZiNum);
                _handPile.AddItem(item, false);
            }
            _handPile.ResetPosition();
            nextPos += lenth * _handPile.Layout.Width + GroupTypeCell + HuCardTypeCell;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 胡牌
        /// </summary>
        /// <param name="huCards"></param>
        private void InitHuCards(List <int> huCards, bool showHuTag = true)
        {
            int lenth = huCards.Count;

            _huPile.transform.localPosition = new Vector3(nextPos, 0);
            for (int i = 0; i < lenth; i++)
            {
                Transform item = GameTools.CreateMahjong(huCards[i], false);
                if (showHuTag)
                {
                    item.GetComponent <MahjongItem>().SetHuTag();
                }
                _huPile.AddItem(item, false);
            }
            _handPile.ResetPosition();
            nextPos += lenth * _handPile.Layout.Width + GroupTypeCell;
        }