Beispiel #1
0
    public void OnPauseClick()
    {
        GameObject pauseMenu   = GameObject.Find("PauseMenu");
        GameObject canvas      = GameObject.Find("Canvas");
        GameObject optionsMenu = GameObject.Find("OptionsMenu");

        if (paused)
        {
            PlayerController.speed = savedSpeed;
            WaterController.StartWater();
            GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>().simulated = true;
            savedSpeed = 0;
            paused     = false;
            pauseMenu.transform.position   = new Vector3(5000f, pauseMenu.transform.position.y, pauseMenu.transform.position.z);
            optionsMenu.transform.position = new Vector3(5000f, optionsMenu.transform.position.y, optionsMenu.transform.position.z);
        }
        else
        {
            savedSpeed             = PlayerController.speed;
            PlayerController.speed = 0;
            GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>().simulated = false;
            WaterController.StopWater();
            paused = true;
            pauseMenu.transform.position = new Vector3(canvas.transform.position.x, pauseMenu.transform.position.y, pauseMenu.transform.position.z);
        }
    }
Beispiel #2
0
    public void OnPauseClick()
    {
        GameObject pauseMenu   = GameObject.Find("PauseMenu");
        GameObject canvas      = GameObject.Find("Canvas");
        GameObject optionsMenu = GameObject.Find("OptionsMenu");

        if (paused)
        {
            PlayerController.speed = savedSpeed;
            WaterController.StartWater();
            savedSpeed = 0;
            paused     = false;
            pauseMenu.transform.position   = new Vector3(5000f, pauseMenu.transform.position.y, pauseMenu.transform.position.z);
            optionsMenu.transform.position = new Vector3(5000f, optionsMenu.transform.position.y, optionsMenu.transform.position.z);
        }
        else
        {
            savedSpeed             = PlayerController.speed;
            PlayerController.speed = 0;
            WaterController.StopWater();
            paused = true;
            pauseMenu.transform.position = new Vector3(canvas.transform.position.x, pauseMenu.transform.position.y, pauseMenu.transform.position.z);
        }
    }
Beispiel #3
0
 void Dash(GameObject collider)
 {
     animator.SetBool("isTeleporting", true);
     playerCollider = collider;
     WaterController.StopWater();
 }