Example #1
0
    private void GameStateChanged(GameState a_oldstate, GameState a_newstate)
    {
        // Leaving the loading state
        if (a_oldstate == GameState.loading)
        {
            StartCoroutine(FadeOutLoading());
        }
        else if (a_oldstate != GameState.mainmenu && a_newstate == GameState.loading)
        {
            StartCoroutine(FadeIntoState());
        }

        if (a_oldstate == GameState.battle)
        {
            battleUI.FadeOut();
            if (Manager.instance.PlayerController.EarthUnit == null && Manager.instance.PlayerController.LightningUnit == null)
            {
                PlaySplashScreen(defeatSplashScreen.GetComponent <Animator>());
            }
            else
            {
                PlaySplashScreen(victorySplashScreen.GetComponent <Animator>());
            }
        }


        if (a_newstate == GameState.cinematic)
        {
            menuHelper.PlayCinematicBars(25, 480);
        }

        if (a_oldstate == GameState.cinematic)
        {
            menuHelper.StopIntroCutscene(25);
        }



        if (a_oldstate != GameState.battle && a_newstate == GameState.battle)
        {
            profiles.UnitProfileSelected(true);
            battleUI.SetButtonsInteractable();
        }

        if (a_oldstate != GameState.battle && a_newstate == GameState.battle)
        {
            UpdateSelectedUnit(player.EarthUnit);
        }
    }
Example #2
0
 public void Hide()
 {
     fade.FadeOut();
 }