public void BuyCharacter() { int currentPoints = PointsUtil.GetCurrentPoints(); var country = countries[PlayerSelectedIndex]; if (currentPoints >= country.UnlockCost) { Debug.Log("COUNTRY BOUGHT"); country.IsLocked = false; PointsUtil.AddPoints(-country.UnlockCost); PointsObject.UpdatePoints(); RefreshSelection(); CountryModel.OverwriteCountries(countries); } else { Debug.Log("NOT ENOUGH POINTS"); } }
public void UpdatePoints() { text = GetComponent <Text>(); text.text = $"points : {PointsUtil.GetCurrentPoints()}"; }