예제 #1
0
        private void SetCpgLayout(PlaybackFrameData data, List <int> removeCards, CpgModel cpg)
        {
            var lastFrameData = data.LastFrameData;
            var outCard       = lastFrameData.Cards[0];

            var group = Game.MahjongGroups;

            group.MahjongThrow[lastFrameData.OpChair].PopMahjong(outCard);
            Game.TableManager.GetParts <MahjongOutCardFlag>(TablePartsType.OutCardFlag).Hide();
            // 移除当前操作玩家手牌
            group.MahjongHandWall[data.OpChair].RemoveMahjong(removeCards);
            // 设置吃碰杠
            group.MahjongCpgs[data.OpChair].SetCpg(cpg);
        }
예제 #2
0
        public virtual void OnInit(CpgModel model)
        {
            Model     = model;
            ItemStore = GameCenter.Scene.MahjongCtrl.PopMahjong(model.Cards);
            for (int i = 0; i < ItemStore.Count; i++)
            {
                ItemStore[i].ExSetParent(transform);
            }

            if (model.Hide)
            {
                SetHideMahjong();
            }
            NormalMahjongLayout(ItemStore);
        }
예제 #3
0
        public void PlaybackMingGang(PlaybackFrameData data)
        {
            var card     = data.Cards[0];
            var allCards = new List <int>()
            {
                card, card, card, card
            };
            var removeCards = new List <int>()
            {
                card, card, card
            };
            var cpg = new CpgModel()
            {
                Cards = allCards
            };

            SetCpgLayout(data, removeCards, cpg);
            PlayEffect(data.OpChair, PoolObjectType.gang);
        }
예제 #4
0
            public void SetData(ISFSObject data)
            {
                var db = GameCenter.DataCenter;

                db.CurrOpSeat = data.TryGetInt(RequestKey.KeySeat);
                GangBao       = data.ContainsKey("bao");
                CurrOpChair   = db.CurrOpChair;
                OldOpChair    = db.OldOpChair;
                CpgData       = MahjongUtility.CreateCpg(data);
                CpgData.Laizi = db.Game.LaiziCard; //cpg中有赖子牌,标记Icon
                CpgType       = CpgData.Type;
                db.Players[db.CurrOpChair].IsTuiDan = data.ContainsKey("tuidan");
                if (CpgType != EnGroupType.ZhuaGang && IsNotXjfdType(CpgType))
                {
                    //将cpg信息添加到玩家数据中
                    GameCenter.DataCenter.Players[CurrOpChair].CpgDatas.Add(CpgData);
                }

                CpgModel = new CpgModel(data);
            }
예제 #5
0
        public void PlaybackAnGang(PlaybackFrameData data)
        {
            var card     = data.Cards[0];
            var allCards = new List <int>()
            {
                card, card, card, card
            };

            var group = Game.MahjongGroups;

            group.MahjongHandWall[data.OpChair].RemoveMahjong(allCards);
            var cpg = new CpgModel()
            {
                Cards = allCards,
                Hide  = true
            };

            group.MahjongCpgs[data.OpChair].SetCpg(cpg);

            PlayEffect(data.OpChair, PoolObjectType.gang);
        }
예제 #6
0
        public void SetCpg(CpgModel model)
        {
            var obj  = GameUtils.GetInstanceAssets <GameObject>("MahjongCpgItem");
            var item = obj.GetComponent <MahjongCpgItem>();

            obj.transform.ExSetParent(transform);
            obj.gameObject.SetActive(true);

            item.OnInit(model);
            CpgItemList.Add(item);

            float offsetx = 0;

            for (int i = 0; i < CpgItemList.Count; i++)
            {
                var itemTransform = CpgItemList[i].transform;
                offsetx -= CpgItemList[i].OffsetX;
                itemTransform.localPosition = new Vector3(offsetx, 0, 0);
                offsetx += CpgInterval;
            }
        }