protected override void Run(ETModel.Session session, Actor_CowCowEmoji message)
        {
            UICowCow_GameRoomComponent  room     = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();
            UICowCow_GamerInfoComponent gameInfo = room.GamerComponent.Get(message.SeatID).GetComponent <UICowCow_GamerInfoComponent>();

            gameInfo.ShowEmoji(message.Index);
        }
Esempio n. 2
0
        protected override void Run(ETModel.Session session, Actor_CowCowDissoltion message)
        {
            UICowCow_GameRoomComponent room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();

            if (!message.IsDiss)
            {
                for (int i = 0; i < message.Info.count; i++)
                {
                    if (i == 0)
                    {
                        room.DissComponent.ShowInitiateDissoltion(message.Info[i].SeatID);
                    }
                    else
                    {
                        room.DissComponent.ShowOtherVote(message.Info[i].SeatID, message.Info[i].IsAgree ? "同意" : "不同意");
                    }
                }
            }
            else
            {
                //解散(销毁)房间,返回大厅
                if (room.GamerComponent.GetGamerCount() == message.Info.count)
                {
                    room.DissComponent.DelayCloseDissoltion().Coroutine();
                }
                room.Dispose();
                Game.EventSystem.Run(CowCowEventIdType.RemoveGameRoom);
                Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowLobby).GetComponent <UICowCowLobbyComponent>().ShowHideLobby(true);
            }
        }
        protected override void Run(ETModel.Session session, Actor_CowCowGamerSubmitCardType message)
        {
            UICowCow_GameRoomComponent room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();

            for (int i = 0; i < message.SeatIDs.count; i++)
            {
                //room.GamerComponent.Get(message.SeatIDs[i]).GetComponent<UICowCow_GamerInfoComponent>()
            }
        }
Esempio n. 4
0
        protected override void Run(ETModel.Session session, Actor_CowCowGamerReady message)
        {
            UICowCow_GameRoomComponent room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();

            room.GamerReady(message.SeatIDs.ToArray());
            if (message.IsFullPeople)
            {
                room.ShowHideGrabBanker(true, message.CurBureau);
            }
        }
        public void ShowHideSmallSettlement(bool isShow)
        {
            CanvasGroup canvasGroup = this.GameObject.GetComponent <CanvasGroup>();

            canvasGroup.blocksRaycasts = isShow;
            canvasGroup.DOFade(isShow ? 1 : 0, 0.5f);
            UICowCow_GameRoomComponent room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();

            if (!isShow)
            {
                Actor_GamerReadyHelper.OnReady(room.GamerComponent.LocalSeatID).Coroutine();
            }
        }
Esempio n. 6
0
        public static async ETVoid OnSubmitHandCard(C2M_CowCowGamerSubmitCardType request)
        {
            Session session = Game.Scene.GetComponent <SessionComponent>().Session;
            UICowCow_GameRoomComponent room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();

            request.UserID = ClientComponent.Instance.User.UserID;
            request.SeatID = room.GamerComponent.LocalSeatID;
            M2C_CowCowGamerSubmitCardType response = (M2C_CowCowGamerSubmitCardType)await session.Call(request);

            if (response.Error == 0)
            {
                //盖牌
            }
        }
        private void OnContinue()
        {
            UICowCow_GameRoomComponent room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();

            if (room.IsLastBureau)
            {
                room.BigSettlement.ShowHideBigSettlement(true);
                return;
            }
            else
            {
                this.ShowHideSmallSettlement(false);
            }
        }
Esempio n. 8
0
        public static async ETVoid SendGrabBanker(int seatId, int multiple)
        {
            Session session = Game.Scene.GetComponent <SessionComponent>().Session;
            M2C_CowCowGrabBanker response = (M2C_CowCowGrabBanker)await session.Call(new C2M_CowCowGrabBanker()
            {
                UserID = ClientComponent.Instance.User.UserID, SeatID = seatId, Multiple = multiple
            });

            if (response.Error == 0)
            {
                //成功
                UICowCow_GameRoomComponent room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();
                room.ShowHideGrabBanker(false);
            }
        }
Esempio n. 9
0
        public static async ETVoid OnReady(int seatId)
        {
            Session session = Game.Scene.GetComponent <SessionComponent>().Session;
            M2C_CowCowGamerReady m2c_Ready = (M2C_CowCowGamerReady)await session.Call(new C2M_CowCowGamerReady()
            {
                UserID = ClientComponent.Instance.User.UserID, SeatID = seatId
            });

            if (m2c_Ready.Error == 0)
            {
                UICowCow_GameRoomComponent  room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();
                UICowCow_GamerInfoComponent gc   = room.GamerComponent.LocalGamer.GetComponent <UICowCow_GamerInfoComponent>();
                room.ShowHideReadyButton(false);
                gc.SetStatus(UIGamerStatus.Ready, UIGamerStatusString.Ready);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// 发牌,只发给自己
        /// </summary>
        protected override void Run(ETModel.Session session, Actor_CowCowRoomDealCards message)
        {
            ResourcesComponent          res  = ETModel.Game.Scene.GetComponent <ResourcesComponent>();
            UICowCow_GameRoomComponent  room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();
            UICowCow_GamerInfoComponent gic  = room.GamerComponent.LocalGamer.GetComponent <UICowCow_GamerInfoComponent>();

            gic.SetCards(message.Cards.ToArray());
            room.DealCardsGiveAllGamer(message.SeatID, message.Multiple);
            Dictionary <int, Gamer> gamers = room.GamerComponent.GetDictAll();

            foreach (Gamer gamer in gamers.Values)
            {
                gamer.GetComponent <UICowCow_GamerInfoComponent>().ShowHideBankerIcon(false);
            }
            room.GamerComponent.Get(message.SeatID).GetComponent <UICowCow_GamerInfoComponent>().ShowHideBankerIcon(true);
        }
        protected override void Run(ETModel.Session session, Actor_CowCowBigSettlement message)
        {
            //直接克隆并设置信息,小结算那里处理何时显示
            UICowCow_GameRoomComponent room   = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();
            Dictionary <int, Gamer>    gamers = room.GamerComponent.GetDictAll();

            for (int i = 0; i < message.Info.Count; i++)
            {
                UICowCow_BSGamerResultComponent bsgrc = gamers[message.Info[i].SeatID].GetComponent <UICowCow_BSGamerResultComponent>();
                bsgrc.SetGamerBigSettlement(message.Info[i].Banker,
                                            message.Info[i].FiveSmallCow,
                                            message.Info[i].FiveFlowerCow,
                                            message.Info[i].BombCow,
                                            message.Info[i].DoubleCow,
                                            message.Info[i].HaveCow,
                                            message.Info[i].NotCow,
                                            message.Info[i].TotalScore);
            }
        }
Esempio n. 12
0
        public void Awake(GameObject parent)
        {
            room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();
            res  = ETModel.Game.Scene.GetComponent <ResourcesComponent>();
            res.LoadBundle(UICowCowAB.CowCow_Prefabs);
            GameObject ab = (GameObject)res.GetAsset(UICowCowAB.CowCow_Prefabs, UICowCowType.CowCowDissoltion);

            this.GameObject = UnityEngine.Object.Instantiate(ab);
            this.GameObject.transform.SetParent(parent.transform, false);
            this.GameObject.name = UICowCowType.CowCowDissoltion;

            ReferenceCollector rc = this.GameObject.GetComponent <ReferenceCollector>();

            gamerInfo   = rc.Get <GameObject>("GamerInfo");
            agreeBtn    = rc.Get <GameObject>("Agree").GetComponent <Button>();
            disagreeBtn = rc.Get <GameObject>("Disagree").GetComponent <Button>();

            agreeBtn.onClick.Add(OnAgree);
            disagreeBtn.onClick.Add(OnDisagree);
        }
Esempio n. 13
0
        protected override void Run(ETModel.Session session, Actor_CowCowJoinGameRoomGroupSend message)
        {
            //这里接收到所有玩家的消息,做处理显示新加入房间的玩家
            UICowCow_GameRoomComponent room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();

            room.AddLocalGamer(message.LocalGamerInfo);
            for (int i = 0; i < message.GamerInfo.count; i++)
            {
                int seatId = message.GamerInfo[i].SeatID - room.GamerComponent.LocalSeatID; //移位
                if (seatId < 0)
                {
                    room.AddGamer(message.GamerInfo[i], seatId + GamerData.Pos.Count);
                }
                else
                {
                    room.AddGamer(message.GamerInfo[i], seatId);
                }
            }
            room.ShowHideInviteButton(!(message.GamerInfo.count == GamerData.Pos.Count - 5));
        }
        protected override void Run(ETModel.Session session, Actor_CowCowRoomOpenCardsAndSettlement message)
        {
            UICowCow_GameRoomComponent room = Game.Scene.GetComponent <UIComponent>().Get(UICowCowType.CowCowGameRoom).GetComponent <UICowCow_GameRoomComponent>();

            room.OpenAllGamerHandCard(message.SmallSettlemntInfo.ToArray()).Coroutine();
        }