private void BirdDeath(Bird bird) { bird.Rigidbody2d.constraints = RigidbodyConstraints2D.FreezeAll; GameObject.Destroy(bird.gameObject); bird.Dead = true; DeadCounter++; if (DeadCounter == PopulationSize) { AllDead?.Invoke(); } }
public void Remove(int id) { aliens.Remove(id); if (aliens.Count % 10 == 0) { increaseAlienSpeed(); } if (aliens.Count == 0) { AllDead?.Invoke(this, null); } }