Пример #1
0
    private IEnumerator respawnFromBombCoroutine()
    {
        playerControler.setPlayerActivity(false);
        playerAnimator.SetBool("IsHurt", true);
        if (deathCounter != 3)
        {
            yield return(new WaitForSeconds(1f));

            deathMessageGUI.text = "Avoid stepping into bombs!";
            AudioSource.PlayClipAtPoint(deathSound, transform.position);

            yield return(new WaitForSeconds(respawnDelay));

            playerAnimator.SetBool("IsHurt", false);
            playerControler.respawn();
        }

        deathMessageGUI.text = "";
        playerControler.setPlayerActivity(true);
    }