Skip to content
Snippets Groups Projects
Commit a710fe19 authored by Matti Loimaranta's avatar Matti Loimaranta
Browse files

Added music change based on population level as comment

parent 4c2dd34a
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ public class PopulationUpgrade : Upgrade ...@@ -7,7 +7,7 @@ public class PopulationUpgrade : Upgrade
// Start is called before the first frame update // Start is called before the first frame update
public void Start() public void Start()
{ {
maxLevelModifier = 10; maxLevelModifier = 5;
} }
// Update is called once per frame // Update is called once per frame
...@@ -21,10 +21,27 @@ public class PopulationUpgrade : Upgrade ...@@ -21,10 +21,27 @@ public class PopulationUpgrade : Upgrade
UpgradeTargets target = UpgradeTargets.population; UpgradeTargets target = UpgradeTargets.population;
City city = gameObject.GetComponent<City>(); City city = gameObject.GetComponent<City>();
int currentLevel = city.GetLevel(target); int currentLevel = city.GetLevel(target);
/*
// Change music based on population level
switch (currentLevel)
{
case 3:
EventSystem.EventHappened(EventType.CityBig);
break;
case 4:
EventSystem.EventHappened(EventType.HuntingSmall);
break;
case 5:
EventSystem.EventHappened(EventType.HuntingBig);
break;
default:
break;
}
*/
if (currentLevel <= city.GetLevel(UpgradeTargets.city) * maxLevelModifier) if (currentLevel <= city.GetLevel(UpgradeTargets.city) * maxLevelModifier)
{ {
city.UseResources(GetPrices(currentLevel)); city.UseResources(GetPrices(currentLevel + 1));
city.AddPopulation(currentLevel * 10); city.AddPopulation(currentLevel * 10);
Debug.Log("population upgraded"); Debug.Log("population upgraded");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment