Beispiel #1
0
    public IEnumerator RespawnPlayer()
    {
        particle.DeathParticleRelease(player.gameObject);
        player.enabled = false;
        player.GetComponent <Renderer>().enabled     = false;
        player.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);
        player.ResetShootingCooldown();
        yield return(new WaitForSeconds(delayBeforeRespawn));

        player.enabled = true;
        player.GetComponent <Renderer>().enabled = true;
        player.transform.position = currentCheckpoint.transform.position;

        particle.RespawnParticleRelease(player);
        yield break;
    }