Пример #1
0
    void BackTask()
    {
        Debug.Log("Back clicked");
        if (TutorialScript.IsTutorialEnabled())
        {
            currentPhase = UI_Phase.SolarSystem;
            planetInfoScreen.style.display = DisplayStyle.None;
            var planetName = backButtonScreen.Q <Label>("name-label");
            planetName.style.display = DisplayStyle.None;
            loadGameScene.UnloadScene();
            planetIsDoneText.SetActive(false);
            //foreach (GameObject infoPanel in planetInfoPanels)
            //{
            //    infoPanel.SetActive(false);
            //}
            //solveButton.SetActive(false);
        }
        switch (currentPhase)
        {
        case UI_Phase.SolarSystem:
            backButtonScreen.style.display = DisplayStyle.None;
            mainMenuScreen.style.display   = DisplayStyle.Flex;
            currentPhase = UI_Phase.MainMenu;
            StartCoroutine(_WaitForCameraMenuPhase());
            ////btmButton.SetActive(false);
            //solarSystem.EnableSolarSystemPhase(false);
            mainCamera.GoMenu();
            tutorial.DisableTutorial();
            loadGameScene.StopWaitingForPlanetClick();

            break;

        case UI_Phase.PlanetInfo:
            mainCamera.GoFree();
            loadGameScene.StartWaitingForPlanetClick();
            currentPhase = UI_Phase.SolarSystem;
            planetInfoScreen.style.display = DisplayStyle.None;
            planetIsDoneText.SetActive(false);
            //foreach (GameObject infoPanel in planetInfoPanels)
            //{
            //    infoPanel.SetActive(false);
            //}
            //solveButton.SetActive(false);
            break;

        case UI_Phase.Puzzle:
            //pauseMenuCanvas.SetActive(true);
            //dificultySwitcherScript.nextButton.GetComponent<Button>().interactable = false;
            //dificultySwitcherScript.prevButton.GetComponent<Button>().interactable = false;
            pauseScreen.style.display      = DisplayStyle.Flex;
            backButtonScreen.style.display = DisplayStyle.None;
            currentPhase   = UI_Phase.Pause;
            Time.timeScale = 0;
            isOnPause      = true;
            //pauseMenuBG.SetActive(true);
            break;

        case UI_Phase.Settings:
            StartCoroutine(_WaitForCameraMenuPhase());
            //settingsSwitcher.ResetSwitchers();
            //btmButton.SetActive(false);
            //settingsMenu.SetActive(false);
            mainCamera.GoMenu();
            break;

        case UI_Phase.Pause:
            Time.timeScale                 = 1;
            currentPhase                   = UI_Phase.Puzzle;
            pauseScreen.style.display      = DisplayStyle.None;
            backButtonScreen.style.display = DisplayStyle.Flex;
            //dificultySwitcherScript.nextButton.GetComponent<Button>().interactable = true;
            //dificultySwitcherScript.prevButton.GetComponent<Button>().interactable = true;
            //pauseMenuBG.SetActive(false);
            //pauseMenuCanvas.SetActive(false);
            isOnPause = false;
            break;

        case UI_Phase.PauseSettings:
            currentPhase = UI_Phase.Pause;

            //settingsMenu.SetActive(false);
            //pauseMenuCanvas.SetActive(true);
            break;
        }
    }
Пример #2
0
    void BackTask()
    {
        Debug.Log("Back clicked");
        if (TutorialScript.IsTutorialEnabled())
        {
            currentPhase = UI_Phase.SolarSystem;
            foreach (GameObject infoPanel in planetInfoPanels)
            {
                infoPanel.SetActive(false);
            }
            solveButton.SetActive(false);
        }
        switch (currentPhase)
        {
        case UI_Phase.SolarSystem:
            StartCoroutine(_WaitForCameraMenuPhase());
            btmButton.SetActive(false);
            solarSystem.EnableSolarSystemPhase(false);
            mainCamera.GoMenu();
            tutorial.DisableTutorial();
            loadGameScene.StopWaitingForPlanetClick();
            break;

        case UI_Phase.PlanetInfo:
            mainCamera.GoFree();
            loadGameScene.StartWaitingForPlanetClick();
            currentPhase = UI_Phase.SolarSystem;
            foreach (GameObject infoPanel in planetInfoPanels)
            {
                infoPanel.SetActive(false);
            }
            solveButton.SetActive(false);
            planetIsDoneText.SetActive(false);
            break;

        case UI_Phase.Puzzle:
            //settingsMenu.SetActive(true);
            pauseMenuCanvas.SetActive(true);
            dificultySwitcherScript.nextButton.GetComponent <Button>().interactable = false;
            dificultySwitcherScript.prevButton.GetComponent <Button>().interactable = false;
            currentPhase   = UI_Phase.Pause;
            Time.timeScale = 0;
            isOnPause      = true;
            tutorialCompleteText.SetActive(false);
            pauseMenuBG.SetActive(true);
            break;

        case UI_Phase.Settings:
            StartCoroutine(_WaitForCameraMenuPhase());
            settingsSwitcher.ResetSwitchers();
            btmButton.SetActive(false);
            settingsMenu.SetActive(false);
            mainCamera.GoMenu();
            break;

        case UI_Phase.Pause:
            Time.timeScale = 1;
            //mainCamera.EnablePuzzleLock(false);
            currentPhase = UI_Phase.Puzzle;
            //StartCoroutine(_WaitForCameraLock(lastActiveInfoPanel));
            //solveButton.SetActive(true);
            dificultySwitcherScript.nextButton.GetComponent <Button>().interactable = true;
            dificultySwitcherScript.prevButton.GetComponent <Button>().interactable = true;
            pauseMenuBG.SetActive(false);
            //settingsMenu.SetActive(false);
            pauseMenuCanvas.SetActive(false);
            isOnPause = false;


            break;

        case UI_Phase.PauseSettings:
            currentPhase = UI_Phase.Pause;
            settingsMenu.SetActive(false);
            pauseMenuCanvas.SetActive(true);
            break;
        }
    }