Example #1
0
    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");
        }
    }
Example #2
0
 public void UpdatePoints()
 {
     text      = GetComponent <Text>();
     text.text = $"points : {PointsUtil.GetCurrentPoints()}";
 }