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

added city level upgrade

parent bbe7934e
No related branches found
No related tags found
No related merge requests found
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CityUpgrade : Upgrade
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void UpgradeCity()
{
UpgradeTargets target = UpgradeTargets.city;
City city = gameObject.GetComponent<City>();
int currentLevel = city.GetLevel(target);
if (city.GetLevel(UpgradeTargets.population) >= 5) {
city.UseResources(GetPrices(currentLevel * 10));
// city.IncreaseCityLevel(); currently not implemented in City
}
}
}
fileFormatVersion: 2
guid: d033c0fdb28116543820fef49807d764
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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