示例#1
0
    private void HandleOnGroupDead()
    {
        groupCtrl.Enable(false);
        PoolManager.instance.ResetPoolObjects(ObjectTypes.Boss1Bullet);
        PoolManager.instance.ResetPoolObjects(ObjectTypes.PlayerBullet);

        UI_Controller  currentUiCtrl = uiMng.GetCurrentUIController();
        UIMenu_EndGame endGamePanel  = currentUiCtrl.GetMenu <UIMenu_EndGame>();

        if (endGamePanel != null)
        {
            endGamePanel.RetryButtonPressed += HandleOnRetry;
            currentUiCtrl.SetCurrentMenu <UIMenu_EndGame>();
        }
        else
        {
            HandleOnRetry();
        }
    }
示例#2
0
    public override void Enter()
    {
        uiMng         = context.GetGameManager().GetUIManager();
        currentUICtrl = uiMng.GetCurrentUIController();

        mainMenuPanel = currentUICtrl.GetMenu <UIMenu_MainMenu>();
        currentUICtrl.SetCurrentMenu <UIMenu_MainMenu>();

        mainMenuPanel.StartButtonPressed += HandleStartButtonPressed;
    }
示例#3
0
    public override void Enter()
    {
        gm    = context.GetGameManager();
        uiMng = gm.GetUIManager();
        uiMng.SetDefaultController();
        uiMng.GetCurrentUIController().SetCurrentMenu <UIMenu_Loading>();

        mainMenuSceneName = gm.GetSceneReferenceManager().GetMainMenuSceneName();

        SceneManager.sceneLoaded += HandleOnSceneLoaded;
        SceneManager.LoadScene(mainMenuSceneName);
    }
示例#4
0
    public override void Enter()
    {
        gm            = context.GetGameManager();
        groupCtrl     = gm.GetLevelManager().GetGroupController();
        uiMng         = context.GetGameManager().GetUIManager();
        currentUICtrl = uiMng.GetCurrentUIController();
        endGamePanel  = currentUICtrl.GetMenu <UIMenu_EndGame>();

        endGamePanel.RetryButtonPressed += HandleRetryButtonPressed;

        groupCtrl.Enable(false);
        currentUICtrl.SetCurrentMenu <UIMenu_EndGame>();
    }
示例#5
0
    public override void Enter()
    {
        uiMng = context.GetGameManager().GetUIManager();

        lvlMng       = context.GetGameManager().GetLevelManager();
        lvlSceneCtrl = lvlMng.GetLevelSceneController();
        lvlPauseCtrl = lvlMng.GetLevelPauseController();
        groupCtrl    = lvlMng.GetGroupController();

        groupCtrl.OnGroupDead           += HandleOnGroupDead;
        lvlSceneCtrl.OnChangeLevelScene += HandleOnChangeLevelScene;
        lvlPauseCtrl.OnGamePause        += HandleOnGamePause;

        uiMng.GetCurrentUIController().SetCurrentMenu <UIMenu_Gameplay>();
    }
示例#6
0
    public override void Enter()
    {
        gm    = context.GetGameManager();
        uiMng = gm.GetUIManager();
        uiMng.SetDefaultController();
        uiMng.GetCurrentUIController().SetCurrentMenu <UIMenu_Loading>();

        lvlMng = gm.GetLevelManager();
        lvlMng.GetGroupController().Enable(false);
        PoolManager.instance.ResetPoolObjects(ObjectTypes.Boss1Bullet);
        PoolManager.instance.ResetPoolObjects(ObjectTypes.PlayerBullet);

        sceneToUnload   = lvlMng.GetLevelSceneController().GetCurrentScene();
        sceneToLoadName = lvlMng.GetLevelSceneController().GetNextSceneName();

        SceneManager.sceneLoaded += HandleOnNewSceneLoaded;
        SceneManager.LoadScene(sceneToLoadName, LoadSceneMode.Additive);
    }
示例#7
0
    public override void Enter()
    {
        Time.timeScale = 0;

        uiMng         = context.GetGameManager().GetUIManager();
        currentUICtrl = uiMng.GetCurrentUIController();

        lvlMng        = context.GetGameManager().GetLevelManager();
        lvlPauseCtrl  = lvlMng.GetLevelPauseController();
        groupCtrl     = lvlMng.GetGroupController();
        uiPausePanel  = currentUICtrl.GetMenu <UIMenu_Pause>();
        gameplayPanel = currentUICtrl.GetMenu <UIMenu_Gameplay>();

        lvlPauseCtrl.OnGameUnpause         += HandleOnGameUnpause;
        uiPausePanel.ResumeButtonPressed   += HandleOnGameUnpause;
        uiPausePanel.MainMenuButtonPressed += HandleOnMainMenuButtonPressed;

        oldGroupStatus = groupCtrl.IsEnabled();
        groupCtrl.Enable(false);
        currentUICtrl.SetCurrentMenu <UIMenu_Pause>();
    }
示例#8
0
    /// <summary>
    /// Funzione che gestisce l'evento di retry button
    /// </summary>
    private void HandleRetryButtonPressed()
    {
        uiMng.SetDefaultController();
        uiMng.GetCurrentUIController().SetCurrentMenu <UIMenu_Loading>();

        PoolManager.instance.ResetPoolObjects(ObjectTypes.Boss1Bullet);
        PoolManager.instance.ResetPoolObjects(ObjectTypes.PlayerBullet);

        Scene sceneToReload = new Scene();

        for (int i = 0; i < SceneManager.sceneCount; i++)
        {
            Scene currentScene = SceneManager.GetSceneAt(i);
            if (currentScene.name != gm.GetSceneReferenceManager().GetSwarmSceneName())
            {
                sceneToReload = currentScene;
                break;
            }
        }

        SceneManager.sceneUnloaded += HandleOnSceneUnloaded;
        SceneManager.UnloadSceneAsync(sceneToReload);
    }