Use existing bindable flow instead

This commit is contained in:
Dean Herbert
2020-09-29 12:45:20 +09:00
parent 585b857a0c
commit d6f3beffb6
10 changed files with 70 additions and 51 deletions

View File

@ -360,7 +360,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
}
[Resolved(canBeNull: true)]
private ISeekableClock seekableClock { get; set; }
private ISamplePlaybackDisabler samplePlaybackDisabler { get; set; }
/// <summary>
/// Calculate the position to be used for sample playback at a specified X position (0..1).
@ -374,18 +374,13 @@ namespace osu.Game.Rulesets.Objects.Drawables
return balance_adjust_amount * (userPositionalHitSounds.Value ? position - 0.5f : 0);
}
/// <summary>
/// Whether samples should currently be playing. Will be false during seek operations.
/// </summary>
protected bool ShouldPlaySamples => seekableClock?.IsSeeking != true;
/// <summary>
/// Plays all the hit sounds for this <see cref="DrawableHitObject"/>.
/// This is invoked automatically when this <see cref="DrawableHitObject"/> is hit.
/// </summary>
public virtual void PlaySamples()
{
if (Samples != null && ShouldPlaySamples)
if (Samples != null)
{
Samples.Balance.Value = CalculateSamplePlaybackBalance(SamplePlaybackPosition);
Samples.Play();