Esempio n. 1
0
    IEnumerator SendPlayerToStart()
    {
        playerController.enabled = false;

        PlayerDeath playerDeath = playerController.GetComponent <PlayerDeath>();
        Image       deathScreen = playerDeath.deathScreen;

        SetAlpha(deathScreen, 1.0f);

        yield return(new WaitForSeconds(0.1f));

        playerDeath.Reset();
        playerController.transform.position = playerDeath.GetStartPosition();

        yield return(new WaitForSeconds(0.1f));

        playerController.enabled = true;

        SetAlpha(deathScreen, 0.0f);
    }