public virtual void TakeDamage() { if (this.GameManager.InstantKill) { this.GameManager.Hits += scoreValue; scoreValue = 0; } else if (this.GameManager.DoubleBurn) { scoreValue -= 2; this.GameManager.Hits += 2; } else { scoreValue--; this.GameManager.Hits++; } if (scoreValue < 1) { TargetDiedEvent?.Invoke(null, null); Destroy(this.gameObject); } }
protected void RaiseTargetDiedEvent() { CurrentAttackState = AttackState.TargetDied; TargetDiedEvent?.Invoke(this); }
/// <summary> /// Just kill the target without worrying about score. /// </summary> public void JustKill() { TargetDiedEvent?.Invoke(null, null); Destroy(this.gameObject); }