private void HandleTargetDestruction() { _count--; if (_count <= 0) { OnDestruct?.Invoke(); } }
public void Hit(int damage) { if (damage < minDamage) { return; } HitPoints -= damage; if (HitPoints <= 0) { OnDestruct?.Invoke(); if (destroy) { Destroy(gameObject, 0); } } }
/// <summary> /// Invokes <see cref="OnDestruct"/> event. /// </summary> public void Destruct() { breakSound?.Play(); OnDestruct?.Invoke(); }
public void Dispose() { OnDestruct?.Invoke(this); this.Handle.LuaBase.ReferenceFree(this.Referance); this.Handle.OnClose -= this.Handle_OnClose; }