mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Use DrawableSample in SkinnableSound class
This commit is contained in:
@ -11,7 +11,6 @@ using osu.Framework.Extensions.TypeExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
@ -96,8 +95,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
/// </remarks>
|
||||
protected virtual float SamplePlaybackPosition => 0.5f;
|
||||
|
||||
private readonly BindableDouble balanceAdjust = new BindableDouble();
|
||||
|
||||
private BindableList<HitSampleInfo> samplesBindable;
|
||||
private Bindable<double> startTimeBindable;
|
||||
private Bindable<bool> userPositionalHitSounds;
|
||||
@ -173,7 +170,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
}
|
||||
|
||||
Samples = new SkinnableSound(samples.Select(s => HitObject.SampleControlPoint.ApplyTo(s)));
|
||||
Samples.AddAdjustment(AdjustableProperty.Balance, balanceAdjust);
|
||||
AddInternal(Samples);
|
||||
}
|
||||
|
||||
@ -360,8 +356,11 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
{
|
||||
const float balance_adjust_amount = 0.4f;
|
||||
|
||||
balanceAdjust.Value = balance_adjust_amount * (userPositionalHitSounds.Value ? SamplePlaybackPosition - 0.5f : 0);
|
||||
Samples?.Play();
|
||||
if (Samples != null)
|
||||
{
|
||||
Samples.Balance.Value = balance_adjust_amount * (userPositionalHitSounds.Value ? SamplePlaybackPosition - 0.5f : 0);
|
||||
Samples.Play();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
Reference in New Issue
Block a user