private void UpdateStat(ref float stat, float amount, StatPreset preset) { stat += preset.increaseRate * amount; stat = Mathf.Clamp(stat, 0f, preset.maxValue); }
private void UpdateStat(ref float stat, StatPreset preset) { stat += preset.increaseAmount * (1 / preset.increaseInterval) * Time.deltaTime; stat = Mathf.Clamp(stat, 0f, preset.maxValue); }