Initial commit
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user