Esempio n. 1
0
    IEnumerator OnDieBehaviour()
    {
        Move(Vector3.zero);
        anim.Play("Dead");
        capsule.height = 0.2f;
        capsule.center = new Vector3(0, 0.3f, 0);
        AudioSource.PlayClipAtPoint(dieSound, transform.position);
        OnDeath.Invoke();

        yield return(new WaitForSeconds(3));

        GameplayStatics.RestartLevel();
    }