building shop UI and grouped objects

This commit is contained in:
Lorenzo
2022-04-13 17:59:58 +02:00
parent c6a8c5c7f3
commit 20fa8f1218
6 changed files with 14613 additions and 5988 deletions

View File

@@ -31,8 +31,15 @@ public class Building : MonoBehaviour
public async Task Upgrade(){
if(curLevel >= buildingData.levels.Count-1){Debug.Log("Already max");return;}
int cost = buildingData.levels[curLevel+1].price;
Debug.Log("Upgrading " + buildingData.buildingName + " for " + cost + " coins");
// Debug.Log("Upgrading " + buildingData.buildingName + " for " + cost + " coins");
switch (curLevel)
{
case 0: Debug.Log("1 Star"); break;
case 1: Debug.Log("2 Stars"); break;
}
await (DBmanager.SetCoins(DBmanager.Coins-cost));
Mathf.Clamp(curLevel++,0, buildingData.levels.Count-1);
}