Ejemplo n.º 1
0
 //It tooks us from Option to Pause panel.
 public void OptionToPause()
 {
     optionPanel.SetActive(false);
     pausePanel.SetActive(true);
     EventSystem.current.SetSelectedGameObject(null);
     EventSystem.current.SetSelectedGameObject(GameObject.Find("ResumeButton"));
     ConfigSaveSystem.Save();
 }
Ejemplo n.º 2
0
    //It tooks us from Option to Menu panel.
    public void OptionToMenu()
    {
        ConfigSaveSystem.Save();

        optionPanel.SetActive(false);
        menuPanel.SetActive(true);
        EventSystem.current.SetSelectedGameObject(null);
        EventSystem.current.SetSelectedGameObject(GameObject.Find("OptionButton"));
    }
Ejemplo n.º 3
0
    //Pausing the menu, the time will be setted to 1 and the player can move again.
    public void Unpause()
    {
        unpauseClip.Play();
        pausePanel.gameObject.SetActive(false);
        optionPanel.gameObject.SetActive(false);
        controlsPanel.gameObject.SetActive(false);
        Time.timeScale = 1f;
        Messenger <bool> .Broadcast(GlobalVariables.ENABLE_INPUT, true);

        Messenger <bool> .Broadcast(GlobalVariables.TOGGLE_AUDIO_ON_OFF, true, MessengerMode.DONT_REQUIRE_LISTENER);

        GlobalVariables.isPaused = false;
        ConfigSaveSystem.Save();        // save configs because the player could modify volumes
        Cursor.visible = false;
    }
Ejemplo n.º 4
0
    private void Start()
    {
        //Load the config file.
        ConfigSaveSystem.Load();
        Cursor.visible = true;

        //Set the values of the sliders basing on the values volume of the enitre. (Thomas)
        soundSlider.value = GlobalVariables.SoundVolume;
        musicSlider.value = GlobalVariables.MusicVolume;

        //If a save file doesn't exists, the Load Button will be interactable. (Thomas)
        if (!File.Exists(Application.dataPath + "/player.txt"))
        {
            loadGameButton.interactable = false;
        }
    }