public void Damage(int dmg, DamagerInterface Damager = null) { if (!death) { Health -= dmg; if (!followingPlayer) { followingPlayer = true; } if (Health <= 0) { death = true; gm.KillEnemy(); zombieAnimator.SetFloat("Death", Random.Range(0, 2)); zombieAnimator.SetTrigger("Kill"); Destroy(myAgent); } else if (!stunt) { SetZombieMovement(false); stunt = true; zombieAnimator.SetTrigger("Stunt"); } } }
public void FenceDamage(int dmg, DamagerInterface Damager) { currentFenceHP -= dmg; if (currentFenceHP <= 0) { normalFence.SetActive(false); brokenFence.SetActive(true); myNavMesh.enabled = false; myCollider.isTrigger = true; myCollider.enabled = false; if (Damager != null) { Damager.StopAttacking(); } Invoke("restoreCollider", 10); } }
private bool death = false; //Tecnicamente un zombie ya está muerto de base pero bueno, ya me entendéis public void Damage(int dmg, DamagerInterface Damager = null) { if (!death) { Health -= dmg; if (!followingPlayer) { followingPlayer = true; } if (Health <= 0) { death = true; //gm.KillEnemy(); //zombieAnimator.SetFloat("Death", Random.Range(0, 2)); //zombieAnimator.SetTrigger("Kill"); Destroy(this.gameObject); Destroy(myAgent); } } }
public void Damage(int dmg, DamagerInterface Damager) { PlayerManager.Instance.DamagePlayer(dmg); }
public void Damage(int dmg, DamagerInterface damager) { FenceDamage(dmg, damager); }