public void TakeDamage(int damage, Actor attacker) { this.CurrentParameter.HitPoint -= damage; if (this.IsDead) { this.CellController.Leave(this); Destroy(this.gameObject); HK.Framework.EventSystems.Broker.Global.Publish(DiedActor.Get(this, attacker)); } }
public void ForceDead() { if (this.StatusController.IsDead) { return; } Destroy(this.gameObject); this.Broker.Publish(DiedActor.Get()); }
public void TakeDamage(int damage) { var oldIsDead = this.IsDead; this.dynamic.HitPoint -= damage; // 初めて死亡した際にイベントを通知する var newIsDead = this.IsDead; if (oldIsDead != newIsDead) { Object.Destroy(this.actor.gameObject); this.actor.Broker.Publish(DiedActor.Get()); } }