Move frequency values into consts

This commit is contained in:
Ron B
2020-08-15 21:19:47 +03:00
parent 40445d0005
commit a1079bac32

View File

@ -85,6 +85,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
} }
private SkinnableSound spinningSample; private SkinnableSound spinningSample;
private const float SPINNING_SAMPLE_INITAL_FREQUENCY = 1.0f;
private const float SPINNING_SAMPLE_MODULATED_BASE_FREQUENCY = 0.5f;
protected override void LoadSamples() protected override void LoadSamples()
{ {
@ -104,7 +106,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
Volume = { Value = 0 }, Volume = { Value = 0 },
Looping = true, Looping = true,
Frequency = { Value = 1.0f } Frequency = { Value = SPINNING_SAMPLE_INITAL_FREQUENCY }
}); });
} }
} }
@ -230,7 +232,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
RotationTracker.Tracking = !Result.HasResult && (OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false); RotationTracker.Tracking = !Result.HasResult && (OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
if (spinningSample != null && spinnerFrequencyModulate) if (spinningSample != null && spinnerFrequencyModulate)
spinningSample.Frequency.Value = 0.5f + Progress; spinningSample.Frequency.Value = SPINNING_SAMPLE_MODULATED_BASE_FREQUENCY + Progress;
} }
protected override void UpdateAfterChildren() protected override void UpdateAfterChildren()