public override void Die(int dam, Frezzeble killer) { hp -= dam; if (hp <= 0) { this.killer = killer; killer.frezze(); hp = 0; AudioSource.PlayClipAtPoint(deathSound, transform.position); Alive = false; rb2d.velocity = new Vector2(0, 0); Invoke("AfterDeath", 0.5f); } }
public virtual void Die(int dam, Frezzeble killer) { hp -= dam; if (hp <= 0) { this.killer = killer; hp = 0; AudioSource.PlayClipAtPoint(deathSound, transform.position); Alive = false; rb2d.velocity = new Vector2(0, 0); this.gameObject.SetActive(false); Invoke("AfterDeath", 0.5f); } }