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());
 }
示例#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);
 }