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