void Sector_OnUnitDeath(object sender, EliminatedEventArgs e)
    {
        if (!ProcessEvents)
            return;

        OnUnitDeath?.Invoke(sender, e);
        Player owner = ((Unit)sender).Owner;
        if (owner.IsEliminated)
            PlayerEliminated(owner, e.Eliminator);
    }
Пример #2
0
 public void UnitDeath(Unit unit)
 {
     if (unit.health <= 0)
     {
         Destroy(gameObject);
         OnUnitDeath?.Invoke(this, new OnUnitDeathEventArgs {
             deadUnit = unit
         });
     }
 }
Пример #3
0
 /// <summary>
 /// Вызывает смерть персонажа.
 /// </summary>
 public void Die()
 {
     OnUnitDeath?.Invoke(this, new UnitEventArgs());
 }
 void Unit_OnDeath(object sender, EliminatedEventArgs e)
 {
     _unit.OnDeath -= Unit_OnDeath;
     OnUnitDeath?.Invoke(sender, e);
 }