Example #1
0
 public void OnGameExitRequest()
 {
     CancelInvoke("HideContainer");
     PauseHelper.PauseGame();
     exitButtonsContainer.active = true;
     fadingBackground.FadeInto(Color.black, 10);
 }
Example #2
0
 private void OnMenuHidden()
 {
     PauseHelper.ResumeGame();
     menuState = MenuState.HIDDEN;
     pauseButton.TogglePauseButton(true);
     DispatchMessage("OnGameResumed", null);
 }
Example #3
0
    private void OnStartTutorial()
    {
        PauseHelper.PauseGame();

        output.enabled   = true;
        isInTutorialMode = true;
    }
Example #4
0
 public void RemovePauseHelper(PauseHelper pauseHelper)
 {
     if (pauseHelper == lastPauseHelper)
     {
         if (pauseHelper == firstPauseHelper)
         {
             pauseHelper.Next     = null;
             pauseHelper.Previous = null;
             lastPauseHelper      = null;
             firstPauseHelper     = null;
         }
         else
         {
             pauseHelper.Previous.Next = null;
             lastPauseHelper           = pauseHelper.Previous;
             pauseHelper.Previous      = null;
         }
     }
     else
     {
         if (pauseHelper == firstPauseHelper)
         {
             pauseHelper.Next.Previous = null;
             firstPauseHelper          = pauseHelper.Next;
             pauseHelper.Next          = null;
         }
         else
         {
             pauseHelper.Next.Previous = pauseHelper.Previous;
             pauseHelper.Previous.Next = pauseHelper.Next;
             pauseHelper.Next          = null;
             pauseHelper.Previous      = null;
         }
     }
 }
Example #5
0
    void ActivatePauseOrResume()
    {
        //pause menu
        if (isPaused)
        {
            pauseMenu.MovePanelPause();
        }
        else
        {
            pauseMenu.MovePanelResume();
        }

        //pause the pausables
        if (firstPauseHelper != null)
        {
            PauseHelper pauseHelper = firstPauseHelper;

            while (pauseHelper.Next != null)
            {
                pauseHelper.PauseOrResume(isPaused);
                pauseHelper = pauseHelper.Next;
            }

            pauseHelper.PauseOrResume(isPaused);
        }
    }
Example #6
0
 private void ContinueGame()
 {
     output.enabled = false;
     PauseHelper.ResumeGame();
     if (animationForCurrentRoomType)
     {
         animationForCurrentRoomType.Hide();
         animationForCurrentRoomType.Stop();
     }
 }
Example #7
0
    public static void LoadSceneQuickly(Scene scene)
    {
        PauseHelper.ResumeGame();
        Time.timeScale = 1f;

        Loader.IS_USING_LOADER      = false;
        Loader.HAS_DONE_FULL_RELOAD = false;

        loadingScene = scene;

        Application.LoadLevel(scene.ToString());
    }
Example #8
0
    public static void LoadScene(Scene scene)
    {
        PauseHelper.ResumeGame();
        Time.timeScale = 1f;

        Loader.IS_USING_LOADER      = true;
        Loader.HAS_USED_LOADER      = true;
        Loader.HAS_DONE_FULL_RELOAD = true;

        loadingScene = scene;

        Application.LoadLevel(Scene.Empty.ToString());
        Application.LoadLevelAdditive(Scene.Loading.ToString());
    }
Example #9
0
    public static void LoadSceneQuickly(Scene scene)
    {
        PlayerInputHelper.ResetInputHelper();

        PauseHelper.ResumeGame();
        Time.timeScale = 1f;

        Loader.IS_USING_LOADER      = false;
        Loader.HAS_DONE_FULL_RELOAD = false;

        loadingScene = scene;

        SceneManager.LoadScene(scene.ToString());
    }
Example #10
0
    public static void LoadSceneAdditive(Scene scene)
    {
        PlayerInputHelper.ResetInputHelper();

        if (GameObject.Find("CameraContainer"))
        {
            GameObject.Find("CameraContainer").SetActive(false);
            GameObject.Find("UICameraContainer").SetActive(false);
        }
        PauseHelper.ResumeGame();
        Time.timeScale = 1f;

        Logger.Log("loading.. " + scene.ToString());
        SceneManager.LoadScene(scene.ToString(), LoadSceneMode.Additive);
    }
Example #11
0
    public static void LoadScene(Scene scene)
    {
        PlayerInputHelper.ResetInputHelper();

        PauseHelper.ResumeGame();
        Time.timeScale = 1f;

        Loader.IS_USING_LOADER      = true;
        Loader.HAS_USED_LOADER      = true;
        Loader.HAS_DONE_FULL_RELOAD = true;

        loadingScene = scene;

        SceneManager.LoadScene(Scene.Empty.ToString(), LoadSceneMode.Single);
        SceneManager.LoadScene(Scene.Loading.ToString(), LoadSceneMode.Additive);
    }
Example #12
0
    public void OnPauseButtonClicked()
    {
        switch (menuState)
        {
        case MenuState.HIDDEN:
            menuState = MenuState.SHOWING;
            PauseHelper.PauseGame();
            ShowMenu();
            DispatchMessage("OnGamePaused", null);
            break;

        case MenuState.SHOWN:
            menuState = MenuState.HIDING;
            HideMenu();
            break;
        }
    }
Example #13
0
    public static void ReloadLevelWithoutLoadingScene(bool isUsingLoader = true)
    {
        PlayerInputHelper.ResetInputHelper();

        PauseHelper.ResumeGame();
        Time.timeScale = 1f;

        string sceneToLoad = loadingScene.ToString();

        if (!Loader.HAS_USED_LOADER)
        {
            sceneToLoad = Application.loadedLevelName;
        }

        Loader.IS_USING_LOADER = isUsingLoader;

        HAS_DONE_FULL_RELOAD = false;
        SceneManager.LoadScene(sceneToLoad, LoadSceneMode.Single);
    }
Example #14
0
    public void AddPauseHelper(PauseHelper pauseHelper)
    {
        if (lastPauseHelper != null /*&& firstPauseHelper != null*/)
        {
            lastPauseHelper.Next = pauseHelper;
            pauseHelper.Previous = lastPauseHelper;

            while (lastPauseHelper.Next != null)
            {
                lastPauseHelper = lastPauseHelper.Next;
            }
        }
        else    //lastPauseHelper == null && firstPauseHelper == null
        {
            lastPauseHelper  = pauseHelper;
            firstPauseHelper = pauseHelper;

            while (lastPauseHelper.Next != null)
            {
                lastPauseHelper = lastPauseHelper.Next;
            }
        }
    }
Example #15
0
 public void OnNoButtonPressed()
 {
     PauseHelper.ResumeGame();
     Invoke("HideContainer", .1f);
     fadingBackground.FadeInto(originalColor, 10);
 }