Ejemplo n.º 1
0
    void Update()
    {
        healthBar.fillAmount = playerHealth.GetHealth() / 100;


        if (playerHealth.GetHealth() <= 0)
        {
            if (Input.GetKeyDown(KeyCode.JoystickButton0))
            {
                SceneManager.LoadScene("Maze");
            }
            if (Input.GetKeyDown(KeyCode.JoystickButton1))
            {
                Application.Quit();
            }
        }
    }