Exemplo n.º 1
0
    /// <summary>
    /// Handles the death of the character. Starts the death sequence defined in DeathManager and respawns the player.
    /// </summary>
    void Die()
    {
        Debug.Log("Die!");
        isDead = true;

        //Pause user input for arms while dead.
        armOne.Paused = true;
        armTwo.Paused = true;

        //Stop camera from following dead octo chunks
        followCamera.Follow = null;

        //Hide the player model
        hidePlayer.EnableRenderers(false);

        armRadius.enabled = false;

        //Start death sequence
        deathManager.Die(currentDeathType);

        //Start post-death coroutine
        waitForDeath = WaitForDeath(deathManager.RespawnTime);
        StartCoroutine(waitForDeath);
    }