예제 #1
0
 public bool ActionWithEnemies(string action, out bool exitAction)
 {
     exitAction = false;
     if (Int32.TryParse(action, out int result))
     {
         if (result == enemies.Count())
         {
             return(true);
         }
         else if (result == enemies.Count() + 1)
         {
             exitAction = true;
             return(true);
         }
         else if (result >= 0 && result < enemies.Count())
         {
             if (FightEnemy(enemies[result]))
             {
                 enemies.Remove(result);
             }
         }
     }
     return(false);
 }
예제 #2
0
 private void OnDestroy()
 {
     collection.Remove(this);
 }