void continueBoss(object sender, EventArgs args) { CurrentEnenmyIndex++; CurrentEnemy.OnEnemyFinished -= continueBoss; CurrentEnemy.DeactiveEnemyComponent(); if (CurrentEnenmyIndex > BossComponents.Count - 1) { OnEnemyFinished?.Invoke(this, new EventArgs()); } else { continueToNextEnemy(); } OnEnemyConditionChange?.Invoke(this, new EventArgs()); }
private void EnemyFinished(WaveHandler handler, IEnemy obj) => OnEnemyFinished?.Invoke(obj);
private void Enemy_OnFinished(IEnemy obj) { OnEnemyDone(); Timeline.Punisher.Punish(obj); OnEnemyFinished?.Invoke(this, obj); }
private void OnTriggerEnter2D(Collider2D other1) { OnEnemyFinished?.Invoke(other1.gameObject); Destroy(other1.gameObject); }