void ApplyProduction() { for (int i = 0; i < PlayerManager.PlayerManagerInstance.ownedPlanets.Count; i++) { Planet planet = PlayerManager.PlayerManagerInstance.ownedPlanets[i]; Debug.Log(PlayerManager.PlayerManagerInstance.ownedPlanets[i].planetName); Debug.Log("Current Production Is: " + planet.starBase.currentProduction); if (planet.starBase != null && planet.starBase.buildCue.Count != 0) { planet.starBase.currentProduction += planet.production; if (planet.starBase.currentProduction >= planet.starBase.buildCue[0].productionValue) { float difference = planet.starBase.currentProduction - planet.starBase.buildCue[0].productionValue; planet.starBase.currentProduction = difference; fm.BuildShip(planet.starBase.buildCue[0]); planet.starBase.buildCue.Remove(planet.starBase.buildCue[0]); GUIManagementScript.GUIManagerInstance.RemoveButtonFromCue(); } GUIManagementScript.GUIManagerInstance.UpdateShipProductionUI(); } } }
void ApplyProduction() { for (int i = 0; i < PlayerManager.PlayerManagerInstance.ownedPlanets.Count; i++) { Planet planet = PlayerManager.PlayerManagerInstance.ownedPlanets[i]; if (planet.starBase != null && planet.starBase.buildCue.Count != 0) { planet.starBase.currentProduction += planet.production; if (planet.starBase.currentProduction >= planet.starBase.buildCue[0].productionValue) { float difference = planet.starBase.currentProduction - planet.starBase.buildCue[0].productionValue; planet.starBase.currentProduction = difference; fm.BuildShip(); planet.starBase.buildCue.Remove(planet.starBase.buildCue[0]); } } } }