Exemplo n.º 1
0
    public bool TryUpdateHealthPropertie()
    {
        if (moneyManager.MoneyAmount >= healthPropertie.Cost)
        {
            moneyManager.ChangeMoneyAmount(-healthPropertie.Cost);
            healthPropertie.Value += healthPropertie.ValueIncreaser;
            healthPropertie.Cost  *= healthPropertie.CostMultiplayer;
            EventsManager.OnHealthPropertieUpdate(healthPropertie.Value, false);
            dataSaver.AddDataToBeSaved(Constants.DataNames.Health, healthPropertie.Value);
            dataSaver.AddDataToBeSaved(Constants.DataNames.HealthCost, healthPropertie.Cost);
            return(true);
        }

        return(false);
    }