Initial commit

This commit is contained in:
2026-09-02 21:14:02 +01:00
parent 10d6c0fa34
commit 41d8d1804d
17 changed files with 9427 additions and 85 deletions

View File

@@ -42,8 +42,17 @@ public class GameManager : MonoBehaviour
population += amountToAdd;
break;
}
// If the dictionary doesn't contain this resource yet, initialize it at 0
if (!statistics.ContainsKey(resourceToAdd))
{
statistics.Add(resourceToAdd, 0);
}
statistics[resourceToAdd] += amountToAdd;
UIController.Instance.UpdateStats();
// Safety check to prevent a crash on Awake
if (UIController.Instance != null)
{
UIController.Instance.UpdateStats();
}
}
public float GetResource(Resource.ResourceType resourceToGet)