예제 #1
0
        private void UpdateStat(ref float stat, float amount, StatPreset preset)
        {
            stat += preset.increaseRate * amount;

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

            stat = Mathf.Clamp(stat, 0f, preset.maxValue);
        }