ShowMenu() public method

public ShowMenu ( ) : void
return void
Exemplo n.º 1
0
    public void Reset()
    {
        loader.Reset();
        world.Reset();
        TileFactory.Clear();
        GameUtils.Seed = 0;
        Serialization.Reset();

        player.transform.position = new Vector3(0f, -3f, 10f);
        player.GetComponent <Rigidbody>().isKinematic = true;
        Active = false;
        boids.StopBoids();
        boids.StartBoids();

        menuGlow.color          = Tile.Brighten(RenderSettings.fogColor, 0.5f);
        RenderSettings.fogColor = Tile.Brighten(Color.Lerp(RenderSettings.fogColor, Color.black, 0.9f), 0.05f);
        RenderSettings.skybox.SetColor("_Tint", RenderSettings.fogColor);
        RenderSettings.fogDensity       = 10f;
        RenderSettings.ambientIntensity = 0f;
        sun.intensity = 0f;
        afterburner.SetActive(false);

        clockText.text  = "";
        chunkText.text  = "";
        dayText.text    = "";
        scoreText.text  = "";
        nameText.text   = "";
        logMessage.text = "";

        startGame.playMusic.StopPlaying();

        StartCoroutine(GetRandomWord());

        showPanels.ShowMenu();
    }
Exemplo n.º 2
0
    public void BackButtonActions()
    {
        int sceneID = SceneManager.GetActiveScene().buildIndex;  // get active scene

        // if not start scene => load home  (from grids and shop)
        if (sceneID != 0)
        {
            SceneManager.LoadScene(0);
        }
        else if (sceneID == 0 && showPanels.isMenuOpen)
        {
            // QuitApplication is appended to this go
            gameObject.GetComponent <QuitApplication>().Quit();
            Debug.Log("quit time");
        }
        else
        {
            // on start go back to main menu
            showPanels.HideOptionsPanel();
            showPanels.HideStylePanel();
            showPanels.HideCustomPanel();

            showPanels.ShowMenu();
        }
    }
Exemplo n.º 3
0
 void DelayReturnMainMenu()
 {
     SceneManager.LoadScene(2);
     PlayMenuMusic();
     showPanels.ShowMenu();
     StartCoroutine(FadeCanvasGroupAlpha(1f, 0f, fadeOutImageCanvasGroup));
     showPanels.menuPanel.SetActive(true);
 }
Exemplo n.º 4
0
    private ShowPanels showPanels;                                                                              //Reference to ShowPanels script on UI GameObject, to show and hide panels


    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();
        showPanels.ShowMenu();
        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();
    }
Exemplo n.º 5
0
 public void DoPause()
 {
     //Set isPaused to true
     isPaused = true;
     //Set time.timescale to 0, this will cause animations and physics to stop updating
     Time.timeScale = 0;
     //call the ShowPausePanel function of the ShowPanels script
     showPanels.ShowMenu();
 }
Exemplo n.º 6
0
    public void ReturnToMenu()
    {
        UnPause();
        showPanels.HidePausePanel();
        showPanels.ShowMenu();

        SceneManager.LoadScene(sceneName);
        //showPanels.HidePausePanel();
        //showPanels.ShowMenu();
    }
Exemplo n.º 7
0
    void OnTriggerEnter(Collider collider)
    {
        if (collider.gameObject.CompareTag("Player"))
        {
            soundBallDrop.PlayWaterSound();
            GameStateManager.Instance.IsStarted = true;
            collider.gameObject.SetActive(false);


            if (showUI != null)
            {
//				Debug.Log("ShowUI is null");

                showUI.ShowMenu();
                showUI.scaleText.SetActive(false);
//				GameStateManager.Instance.BestScore = PlayerPrefs.GetInt("CurBestScore");
                GameStateManager.Instance.Load();

//				Debug.Log(GameStateManager.Instance.BestScore);
                if (GameStateManager.Instance.BestScore < GameStateManager.HighScore)
                {
                    GameStateManager.Instance.BestScore = GameStateManager.HighScore;
                    GameStateManager.Instance.Save();
                }

                Social.ReportScore(GameStateManager.Instance.BestScore, GPSTest.leaderboard_best_of_the_best, (bool success) => {
                    //Report the best score to Google API
                });

                updateScore.EndGameScore();
            }
            else if (showUI == null)
            {
                Debug.Log("ShowUI is not null");
                showUI.ShowMenu();
            }
//			Debug.Log(collider.gameObject.tag);
//			Time.timeScale = 0;
//			GameStateManager.Instance.StartGame();
//			GameStateManager.Instance.Restart();
        }
    }
Exemplo n.º 8
0
    public void ReturnToMenu()
    {
        showPanels = GetComponent <ShowPanels>();
        ui         = GetComponent <StartOptions>();
        showPanels.HidePausePanel();
        showPanels.ShowMenu();
        ui.changeScenes = false;
        ui.inMainMenu   = true;

        SceneManager.LoadScene(0);
    }
Exemplo n.º 9
0
 private void LoadDelayedToMenu()
 {
     // Hide the Congratulations panel UI element and
     // show the HUD panel UI element
     Pause.current.UnCongratulation();
     // Hide the HUD panel UI element
     showPanels.HideHudPanel();
     // Show the main menu UI element
     showPanels.ShowMenu();
     showPanels.ShowVersion();
     m_bThanksPanel = false;
     // Load the selected scene, by scene index number in build settings
     StartCoroutine(AsyncLoading(sceneToGo));
 }
Exemplo n.º 10
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        if (sceneToStart != 0)
        {
            showPanels.HideMenu();
        }
        //Load the selected scene, by scene index number in build settings
        SceneManager.LoadScene(sceneToStart);
        if (sceneToStart == 0)
        {
            showPanels.ShowMenu();
        }
    }
Exemplo n.º 11
0
    private void Update()
    {
        if (!menu.notInMenu)
        {
            if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.D))
            {
                if (onResume)
                {
                    onResume = false;
                }
                resume.GetComponent <Image>().color = normalColor;
                goMenu.GetComponent <Image>().color = highlightedColor;
                butSound.ButtonChangeSound();
            }
            if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.A))
            {
                if (!onResume)
                {
                    onResume = true;
                }
                resume.GetComponent <Image>().color = highlightedColor;
                goMenu.GetComponent <Image>().color = normalColor;
                butSound.ButtonChangeSound();
            }

            if (Input.GetButtonDown("Submit"))
            {
                butSound.OnClickSound();

                if (onResume)
                {
                    pauseScript.UnPause();
                    showpanels.HidePausePanel();
                }
                else
                {
                    pauseScript.UnPause();
                    showpanels.HidePausePanel();
                    showpanels.ShowMenu();
                    SceneManager.LoadScene(0);
                }
            }
        }
    }
Exemplo n.º 12
0
    //Once the level has loaded, check if we want to call PlayLevelMusic
    void SceneWasLoaded(Scene scene, LoadSceneMode mode)
    {
        //if changeMusicOnStart is true, call the PlayLevelMusic function of playMusic
        if (menuSettingsData.musicLoopToChangeTo != null)
        {
            playMusic.PlayLevelMusic();
        }
        Debug.Log("OnSceneLoaded: " + scene.name);
        Debug.Log(mode);

        if (scene.name != "MainMenu")
        {
            Debug.Log("OnSceneLoaded: not MainMenu is " + scene.name);
            StartCoroutine(FadeCanvasGroupAlphaHideMenu(1f, 0f, fadeOutImageCanvasGroup));
            StartCoroutine(FadeCanvasGroupAlphaHideMenu(1f, 0f, BackgroundImageCanvasGroup));
        }
        else
        {
            Debug.Log("OnSceneLoaded: so MainMenu is " + scene.name);
            showPanels.ShowMenu();
            StartCoroutine(FadeCanvasGroupAlpha(0f, 1f, BackgroundImageCanvasGroup));
        }
    }
Exemplo n.º 13
0
 public void HideCredits()
 {
     showPanels.HideCredits();
     showPanels.ShowMenu();
     lockCredits = false;
 }
 public void HideGameoverPanel()
 {
     showPanels.HideGameOverPanel();
     showPanels.ShowMenu();
     FadeIn();
 }
Exemplo n.º 15
0
 public void ReturnFromLevelSelect()
 {
     showPanels.HideLevels();
     showPanels.ShowMenu();
 }
Exemplo n.º 16
0
 public void OpenMainmenu()
 {
     showPanels.ShowMenu();
     showPanels.HideInGame();
 }
Exemplo n.º 17
0
    /// <summary>
    /// Chamada quando uma cena e carregada
    /// Nota: Esta funcao e chamada pelo Awake e OnLevelWasLoaded,
    /// e nao faz parte do Unity
    /// </summary>
    void OnLevelLoad()
    {
        // Gera uma nova UI, isso deve acontecer no menu principal
        if (showPanels == null) {
            GameObject ui = GameObject.Instantiate(UIPrefab);
            showPanels = ui.GetComponent<ShowPanels>();
            showPanels.ShowMenu();
        }

        // Atualiza qual fase o jogo esta
        currentLevel = GetLevelEnum ();
        if (currentLevel != Constants.Levels.None) {
            // retorna NULL se nao achou nada com a TAG
            GameObject[] pickUps = GameObject.FindGameObjectsWithTag (Constants.Tags.PickUps) as GameObject[];
            pickUpsTotal = pickUps.Length; //conta o total de pickups na fase, de acordo com o vetor pickUps
            if (pickUps == null || pickUps.Length == 0) {
                Debug.LogWarning ("Nenhum pickup encontrado");
                return;
            }

            pickUpsTotal = pickUps.Length;
            gameTime = 0;
            score = 0;

            pickUpsGet = 0;

            // Ativa o HUD
            showPanels.ShowGameScreen ();

            // Inicializa um relogio interno
            InvokeRepeating ("GameTimer", 0f, 1f);
        } else {
            // confirma que o HUD esta desativado
            showPanels.HideGameScreen();
        }

        count = 0;
        Instance = this;
    }