private void onLobbyEnded()
 {
     if (spawnedLobby != null)
     {
         UnityEngine.Object.Destroy(spawnedLobby.gameObject);
     }
     if (currentState == DanceBattleVisualsState.Lobby)
     {
         turnOffEffects();
         if (localPlayerIsInGame && (numPlayersInLobby < partyGameDefinition.MinPlayerCount || redTeamLobbyCount == 0 || blueTeamLobbyCount == 0))
         {
             Service.Get <PromptManager>().ShowPrompt("PartyGameNotEnoughPlayersPrompt", null);
             DanceBattleUtils.LogNotEnoughPlayersBI();
             PartyGameUtils.EnableMainNavigation();
         }
         localPlayerIsInGame = false;
         EventManager.Instance.PostEvent("MUS/Town/DJCadence", EventAction.SetSwitch, "Evergreen", musicTargetObject);
     }
     if (topHud != null)
     {
         RemoveTopHud();
     }
     numPlayersInLobby = 0;
     LobbyCamera.gameObject.SetActive(value: false);
 }
Esempio n. 2
0
 private bool onSceneTransition(SceneTransitionEvents.TransitionStart evt)
 {
     dispatcher.RemoveListener <SceneTransitionEvents.TransitionStart>(onSceneTransition);
     PartyGameUtils.EnableMainNavigation();
     PartyGameUtils.EnableLocomotionControls();
     PartyGameUtils.EnableCellPhoneButton();
     enableDanceMoveControls();
     dispatcher.RemoveListener <ControlsScreenEvents.ControlLayoutLoadComplete>(onControlLayoutLoadComplete);
     return(false);
 }
Esempio n. 3
0
 private void handleLocalPlayerLeftLobby()
 {
     isLocalPlayerInLobby = false;
     Service.Get <EventDispatcher>().DispatchEvent(default(TubeRaceEvents.LocalPlayerLeftLobby));
     moveLocalPlayerToPosition(LobbyExitPosition.position);
     LocomotionHelper.SetCurrentController <RunController>(SceneRefs.ZoneLocalPlayerManager.LocalPlayerGameObject);
     Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.EnableUIElement("ControlsButton2"));
     Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.EnableUIElement("ActionButton"));
     PartyGameUtils.EnableMainNavigation();
     PartyGameUtils.EnableCellPhoneButton();
     Service.Get <EventDispatcher>().DispatchEvent(new PlayerCardEvents.SetEnablePlayerCard(enable: true));
     Service.Get <QuestService>().SendEvent($"Cancel{RaceDefinition.QuestEventIdentifier}Race");
 }
Esempio n. 4
0
 protected override void destroy()
 {
     PartyGameUtils.EnableMainNavigation();
     PartyGameUtils.RemoveParticipationFilter(localPlayerParticipationController);
     PartyGameUtils.RemoveActionConfirmationFilter();
     PartyGameUtils.EnableCellPhoneButton();
     removeEventListeners();
     changeToDefaultCamera();
     changeControlState(ControlsState.Enabled);
     Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.EnableUIElement("ChatButtons"));
     if (danceBattleVisualsController != null)
     {
         danceBattleVisualsController.RemoveTopHud();
     }
 }
Esempio n. 5
0
 protected override void destroy()
 {
     dispatcher.RemoveListener <InputEvents.ActionEvent>(onActionEvent);
     ResetCamera();
     showRemotePlayers();
     removeListeners();
     PartyGameUtils.RemoveParticipationFilter(localPlayerParticipationController);
     PartyGameUtils.RemoveActionConfirmationFilter();
     PartyGameUtils.EnableMainNavigation();
     PartyGameUtils.EnableLocomotionControls();
     dispatcher.DispatchEvent(default(ControlsScreenEvents.ReturnToDefaultLeftOption));
     Object.Destroy(boardGameObject);
     Object.Destroy(hudUI.gameObject);
     PartyGameUtils.EnableCellPhoneButton();
     dispatcher.DispatchEvent(new PlayerCardEvents.SetEnablePlayerCard(enable: true));
     CoroutineRunner.StopAllForOwner(this);
 }
        private void onLobbyPlayersUpdated(PartyGamePlayerCollection players)
        {
            bool flag = false;

            redTeamLobbyCount  = 0;
            blueTeamLobbyCount = 0;
            for (int i = 0; i < players.Players.Count; i++)
            {
                PartyGamePlayer partyGamePlayer = players.Players[i];
                if (partyGamePlayer.UserSessionId == localPlayerSessionId)
                {
                    flag = true;
                    localPlayerTeamId = partyGamePlayer.TeamId;
                    if (!localPlayerIsInGame)
                    {
                        moveLocalPlayerToPosition(spawnedLobby.GetPlayerPosition(partyGamePlayer.TeamId, partyGamePlayer.RoleId));
                        CoroutineRunner.Start(createTopHud(), this, "createTopHud");
                        DanceBattleUtils.LogPlayerJoinDanceBI(players.Players.Count);
                    }
                }
                if (partyGamePlayer.TeamId == 1)
                {
                    redTeamLobbyCount++;
                }
                else
                {
                    blueTeamLobbyCount++;
                }
            }
            if (localPlayerIsInGame && !flag)
            {
                if (topHud != null)
                {
                    RemoveTopHud();
                }
                PartyGameUtils.EnableMainNavigation();
            }
            else if (!localPlayerIsInGame && flag)
            {
                PartyGameUtils.DisableMainNavigation();
            }
            numPlayersInLobby   = players.Players.Count;
            localPlayerIsInGame = flag;
            LobbyCamera.gameObject.SetActive(localPlayerIsInGame);
        }
Esempio n. 7
0
 protected override void destroy()
 {
     PartyGameUtils.RemoveParticipationFilter(localPlayerParticipationController);
     PartyGameUtils.RemoveActionConfirmationFilter();
     PartyGameUtils.EnableMainNavigation();
     PartyGameUtils.EnableLocomotionControls();
     animationController.Destroy();
     removeListeners();
     ResetCamera();
     UnityEngine.Object.Destroy(hudUI.gameObject);
     UnityEngine.Object.Destroy(cannonGameObject);
     if (animationController != null)
     {
         FishBucketAnimationController fishBucketAnimationController = animationController;
         fishBucketAnimationController.CannonRotationCompleteAction = (System.Action)Delegate.Remove(fishBucketAnimationController.CannonRotationCompleteAction, new System.Action(onCannonRotationComplete));
     }
     CoroutineRunner.StopAllForOwner(this);
     currentState = FishBucketState.Finished;
     PartyGameUtils.EnableCellPhoneButton();
     Service.Get <EventDispatcher>().DispatchEvent(new PartyGameEvents.PartyGameEnded(partyGameDefinition));
 }