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);
    }
Exemplo n.º 2
0
 public void UnitDeath(Unit unit)
 {
     if (unit.health <= 0)
     {
         Destroy(gameObject);
         OnUnitDeath?.Invoke(this, new OnUnitDeathEventArgs {
             deadUnit = unit
         });
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Вызывает смерть персонажа.
 /// </summary>
 public void Die()
 {
     OnUnitDeath?.Invoke(this, new UnitEventArgs());
 }
Exemplo n.º 4
0
 // base death function
 protected void die()
 {
     onDie += deactivateMe;//for now we pass the function with the disable effect
     onDie();
 }
 void Unit_OnDeath(object sender, EliminatedEventArgs e)
 {
     _unit.OnDeath -= Unit_OnDeath;
     OnUnitDeath?.Invoke(sender, e);
 }