Esempio n. 1
0
 public void TrainNewUnit(UnitTrainingInfo info)
 {
     if (queuedUnitsToTrain.Count < 4)
     {
         queuedUnitsToTrain.Enqueue(info);
     }
 }
Esempio n. 2
0
 void Update()
 {
     timer += Time.deltaTime;
     if (queuedUnitsToTrain.Count > 0 && !IsTraining)
     {
         IsTraining          = true;
         CurrentTrainingUnit = queuedUnitsToTrain.Dequeue();
         timer = 0;
     }
     //ToDo: Change this to be less terrible
     if (timer >= 0 && IsTraining)
     {
         ArmyManager.inst.SpawnUnit(ID, CurrentTrainingUnit.unitType, CurrentTrainingUnit.UnitCount);
         IsTraining = false;
     }
 }