Exemplo n.º 1
0
        protected override void Run(Gameover message)
        {
            UI             uiRoom             = Hotfix.Scene.GetComponent <UIComponent>().Get(UIType.Room);
            GamerComponent gamerComponent     = uiRoom.GetComponent <GamerComponent>();
            Identity       localGamerIdentity = gamerComponent.LocalGamer.GetComponent <HandCardsComponent>().AccessIdentity;
            UI             uiEndPanel         = UIEndFactory.Create(Hotfix.Scene, UIType.EndPanel, uiRoom, message.Winner == localGamerIdentity);
            UIEndComponent endComponent       = uiEndPanel.GetComponent <UIEndComponent>();

            uiRoom.Add(uiEndPanel);

            foreach (var gamer in gamerComponent.GetAll())
            {
                gamer.GetComponent <GamerUIComponent>().UpdateInfo();
                gamer.GetComponent <HandCardsComponent>().Hide();
                endComponent.CreateGamerContent(
                    gamer,
                    message.Winner,
                    message.BasePointPerMatch,
                    message.Multiples,
                    message.GamersScore[gamer.Id]);
            }

            UIRoomComponent uiRoomComponent = uiRoom.GetComponent <UIRoomComponent>();

            uiRoomComponent.Interaction.Gameover();
            uiRoomComponent.ResetMultiples();
        }
Exemplo n.º 2
0
        public UI Create(Scene scene, int type, UI parent)
        {
            GameObject bundleGameObject = scene.ModelScene.GetComponent <ResourcesComponent>().GetAsset <GameObject>("uilobby", "Lobby");
            GameObject lobby            = UnityEngine.Object.Instantiate(bundleGameObject);

            lobby.layer = LayerMask.NameToLayer(LayerNames.UI);
            UI ui = new UI(scene, type, parent, lobby);

            parent.Add(ui);

            ui.AddComponent <UILobbyComponent>();
            return(ui);
        }