Esempio n. 1
0
 public void QuiteGame()
 {
     Time.timeScale = 1;
     pauseUI.SetActive(false);
     gamePauseState = PAUSESTATE.GAME_IS_RUNNING;
     Application.Quit();
 }
Esempio n. 2
0
 public void RetrunToTitle()
 {
     Time.timeScale = 1;
     pauseUI.SetActive(false);
     gamePauseState = PAUSESTATE.GAME_IS_RUNNING;
     SceneManager.LoadScene(0);
 }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        Time.timeScale = 1;
        //pauseUI = GameObject.Find("PauseUI");
        pauseUI.SetActive(false);
        gamePauseState = PAUSESTATE.GAME_IS_RUNNING;

        audioSource = GetComponent <AudioSource>();
        BGM         = GameObject.Find("GameBGM").GetComponent <AudioSource>();
    }
Esempio n. 4
0
    // Update is called once per frame
    void Update()
    {
        if (gamePauseState == PAUSESTATE.GAME_IS_RUNNING)
        {
            if (Input.GetButtonDown("Start") || Input.GetKeyDown(KeyCode.U))
            {
                Time.timeScale = 0;
                pauseUI.SetActive(true);
                gamePauseState = PAUSESTATE.GAME_IS_PAUSED;

                if (BGM.clip != null)
                {
                    BGM.Pause();
                }

                if (audioSource.clip != null)
                {
                    audioSource.Play();
                }
            }
        }


        else if (gamePauseState == PAUSESTATE.GAME_IS_PAUSED)
        {
            if (Input.GetButtonDown("Start") || Input.GetKeyDown(KeyCode.U))
            {
                Time.timeScale = 1;
                pauseUI.SetActive(false);
                gamePauseState = PAUSESTATE.GAME_IS_RUNNING;

                if (BGM.clip != null)
                {
                    BGM.Play();
                }
            }
        }
    }
Esempio n. 5
0
 public void ResumeGameCaller()
 {
     Time.timeScale = 1;
     pauseUI.SetActive(false);
     gamePauseState = PAUSESTATE.GAME_IS_RUNNING;
 }
 public void SetPauseState(PAUSESTATE set)
 {
     state = set;
 }