mirror of
https://github.com/osukey/osukey.git
synced 2025-06-03 11:57:36 +09:00
Add better sample fallback logic
Also adds support for null channels at InputDrum level.
This commit is contained in:
parent
46ef17354e
commit
3f73a9a693
@ -152,14 +152,14 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
target = centreHit;
|
||||
back = centre;
|
||||
|
||||
drumSample.Centre.Play();
|
||||
drumSample.Centre?.Play();
|
||||
}
|
||||
else if (action == RimAction)
|
||||
{
|
||||
target = rimHit;
|
||||
back = rim;
|
||||
|
||||
drumSample.Rim.Play();
|
||||
drumSample.Rim?.Play();
|
||||
}
|
||||
|
||||
if (target != null)
|
||||
|
@ -17,8 +17,18 @@ namespace osu.Game.Audio
|
||||
|
||||
public SampleChannel GetChannel(SampleManager manager, string resourceNamespace = null)
|
||||
{
|
||||
SampleChannel channel = manager.Get(Path.Combine("Gameplay", resourceNamespace ?? string.Empty, $"{Bank}-{Name}"));
|
||||
channel.Volume.Value = Volume / 100.0;
|
||||
SampleChannel channel = null;
|
||||
|
||||
if (resourceNamespace != null)
|
||||
channel = manager.Get(Path.Combine("Gameplay", resourceNamespace, $"{Bank}-{Name}"));
|
||||
|
||||
// try without namespace as a fallback.
|
||||
if (channel == null)
|
||||
channel = manager.Get(Path.Combine("Gameplay", $"{Bank}-{Name}"));
|
||||
|
||||
if (channel != null)
|
||||
channel.Volume.Value = Volume / 100.0;
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user