public void Death() { OnEntityKilled?.Invoke(this); // Instantiate Explosion and Destroy this GameObject GameObject explosion = ObjectPool.Instance.GetPooledObject(ObjectPool.PoolType.Explosion, transform.position, Quaternion.identity); gameObject.SetActive(false); }
// IDamageable - Behaviour to run when the Enemy has no health left public virtual void Death() { // Triggers Death Event. OnEntityKilled?.Invoke(this); }
public override void Die(Entity byEntity) { ConsolePrinter.PrintAction(byEntity, "killed", this, true); OnEntityKilled.Invoke(this); }