Exemplo n.º 1
0
    private void FixedUpdate()
    {
        bool isDogDead    = dogReference.transform.position.y < yCoordinateForReset;
        bool isZombieDead = zombieReference.transform.position.y < yCoordinateForReset;

        if (isDogDead || isZombieDead)
        {
            ZombieDeathBehavior deathBehavior = zombieReference.GetComponentInChildren <ZombieDeathBehavior>();
            deathBehavior.OnDeath();
        }
    }
 private void OnZombieDied()
 {
     deathBehavior.OnDeath();
 }