public void AddToCrowdArray(GameUnitName gameUnitName, float radius)
 {
     for (int i = 0; i < CrowdArray.Count; ++i)
     {
         if (CrowdArray[i] == gameUnitName)
         {
             CrowdArray.Insert(i, gameUnitName);
             CrowdArrayRadius.Insert(i, radius);
             return;
         }
     }
     CrowdArray.Add(gameUnitName);
     CrowdArrayRadius.Add(radius);
 }
Beispiel #2
0
        public virtual void ProductUnits(string name)
        {
            GameUnitName gameUnitName = (GameUnitName)System.Enum.Parse(typeof(GameUnitName), name);

            if (productionQueue.Count >= Gross)
            {
                return;
            }
            productionTime += unitProductionTime;
            productionQueue.Enqueue(gameUnitName);
            if (productionQueue.Count == 1)
            {
                StartCoroutine(ProductingUnits());
            }
        }