Beispiel #1
0
 void SelectNextUnit()
 {
     if (state != MapState.UserControl)
     {
         return;
     }
     if (selectedUnit == null)
     {
         SelectUnit(units[0]);
         tweener.Tween(scene.GetCamera(), new { posX = selectedUnit.realPosition.X, posY = selectedUnit.realPosition.Y }, 0.5f);
         return;
     }
     for (int i = 0; i < units.Count; i++)
     {
         if (units[i] == selectedUnit)
         {
             SelectUnit(units[(i + 1) % units.Count]);
             tweener.Tween(scene.GetCamera(), new { posX = selectedUnit.realPosition.X, posY = selectedUnit.realPosition.Y }, 0.5f);
             return;
         }
     }
 }