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