コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (playerHealth < 0.0f)
        {
            player player = FindObjectOfType <player> ();
            if (player)
            {
                player.Explode();
            }
            Invoke("EndGame", 1f);
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (gameIsPaused == true && gameOver == false)
            {
                Resume();
            }
            else if (gameIsPaused == false && gameOver == false)
            {
                Pause();
            }
        }
    }