building shop UI and grouped objects
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user