mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:35:34 +08:00
Add support for playing a SkinnableSample without restarting it
This commit is contained in:
parent
40f020c683
commit
8a6857f151
@ -67,7 +67,7 @@ namespace osu.Game.Skinning
|
||||
}
|
||||
}
|
||||
|
||||
public override void Play()
|
||||
public override void Play(bool restart = true)
|
||||
{
|
||||
cancelPendingStart();
|
||||
RequestedPlaying = true;
|
||||
@ -75,7 +75,7 @@ namespace osu.Game.Skinning
|
||||
if (samplePlaybackDisabled.Value)
|
||||
return;
|
||||
|
||||
base.Play();
|
||||
base.Play(restart);
|
||||
}
|
||||
|
||||
public override void Stop()
|
||||
|
@ -119,12 +119,13 @@ namespace osu.Game.Skinning
|
||||
/// <summary>
|
||||
/// Plays the samples.
|
||||
/// </summary>
|
||||
public virtual void Play()
|
||||
/// <param name="restart">Whether to play the sample from the beginning.</param>
|
||||
public virtual void Play(bool restart = true)
|
||||
{
|
||||
samplesContainer.ForEach(c =>
|
||||
{
|
||||
if (PlayWhenZeroVolume || c.AggregateVolume.Value > 0)
|
||||
c.Play();
|
||||
c.Play(restart);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user