Ability to contain multiple sample banks. Get default bank name from control point.

This commit is contained in:
smoogipooo
2017-04-05 21:59:07 +09:00
parent 8d720e39c6
commit d607207b69
11 changed files with 46 additions and 28 deletions

View File

@ -67,7 +67,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
ComboIndex = s.ComboIndex,
Scale = s.Scale,
ComboColour = s.ComboColour,
SampleBank = s.SampleBank,
SampleBanks = s.SampleBanks,
}),
};

View File

@ -12,6 +12,7 @@ using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Judgements;
using OpenTK;
using OpenTK.Graphics;
using System.Collections.Generic;
namespace osu.Game.Modes.Osu.Objects.Drawables
{
@ -28,6 +29,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
protected override OsuJudgement CreateJudgement() => new OsuJudgement { MaxScore = OsuScoreResult.SliderTick };
private List<SampleChannel> samples = new List<SampleChannel>();
public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick)
{
this.sliderTick = sliderTick;
@ -53,20 +56,18 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
};
}
private SampleChannel sample;
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
sample = audio.Sample.Get($@"Gameplay/{HitObject.SampleBank.Name}-slidertick");
foreach (var bank in HitObject.SampleBanks)
samples.Add(audio.Sample.Get($@"Gameplay/{bank.Name}-slidertick"));
}
protected override void PlaySamples()
{
sample?.Play();
samples.ForEach(s => s?.Play());
}
protected override void CheckJudgement(bool userTriggered)
{
if (Judgement.TimeOffset >= 0)

View File

@ -95,7 +95,7 @@ namespace osu.Game.Modes.Osu.Objects
StackHeight = StackHeight,
Scale = Scale,
ComboColour = ComboColour,
SampleBank = SampleBank
SampleBanks = SampleBanks
};
}
}