Example #1
0
    private void OnGameOver( )
    {
        IState              nextState  = new RoundEndState(round);
        IStateTransition    transition = new LoadingTransition(round.LoadedTransitionOutroAsset);
        StateBeginExitEvent exitEvent  = new StateBeginExitEvent(nextState, transition);

        musicplayer.MusicCheck(true);

        if (RaiseStateChangeEvent != null)
        {
            RaiseStateChangeEvent(exitEvent);
        }
    }
Example #2
0
    protected override void MapButtons( )
    {
        foreach (Button btn in menuButtons)
        {
            if (btn.CompareTag(TagsUI.startNewGameBtn))                   // btn - starts a new round
            {
                btn.onClick.RemoveAllListeners( );
                btn.onClick.AddListener(() => {
                    float fadeTime = 1.8f;
                    SFXMasterController.PlayNoMercyClip( );
                    IState nextState                  = new RoundLoadState(fadeTime);
                    IStateTransition transition       = new MenuExitTransition(menuObject);
                    StateBeginExitEvent newRoundState = new StateBeginExitEvent(nextState, transition);
                    audioplayer.PlayOneShot(btnClick);
                    musicplayer.MusicCheck(true);

                    RaiseUIEvent(newRoundState);
                });
            }
            else if (btn.CompareTag(TagsUI.returnToMainMenuBtn))          // btn - returns to main menu
            {
                btn.onClick.RemoveAllListeners( );
                btn.onClick.AddListener(() => {
                    IState nextState            = new MainMenuState();
                    IStateTransition transition = new LoadingTransition(menuObject);
                    StateBeginExitEvent returnToMainMenustate = new StateBeginExitEvent(nextState, transition);
                    audioplayer.PlayOneShot(btnClick);

                    RaiseUIEvent(returnToMainMenustate);
                });
            }
            else if (btn.CompareTag(TagsUI.settingsMenuBtn))              // btn - opens settings menu
            {
                btn.onClick.RemoveAllListeners( );
                btn.onClick.AddListener(() => {
                    audioplayer.PlayOneShot(btnClick);
                    Debug.Log("[EndOfRoundMenu][OnToggleSettingsMenu] Settings menu not yet implemented ... ");
                });
            }
        }
    }
 public void EnterState()
 {
     menu.MakeActiveInScene( );
     musicplayer.MusicCheck(false);
 }