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
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player" && tag == "Respawn")
     {
         WaterController.StartWater();
     }
 }
Beispiel #3
0
 public void DashAbilityEnded()
 {
     animator.SetBool("isTeleporting", false);
     transform.position = new Vector3(gameObject.transform.position.x, playerCollider.transform.position.y - (boxCollider.size.y / 2), gameObject.transform.position.z);
     GameController.amountOfPlatforms += 1;
     GameController.updateFloorCount();
     playerCollider = null;
     WaterController.StartWater();
 }
Beispiel #4
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);
        }
    }