mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 05:19:11 +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;
|
target = centreHit;
|
||||||
back = centre;
|
back = centre;
|
||||||
|
|
||||||
drumSample.Centre.Play();
|
drumSample.Centre?.Play();
|
||||||
}
|
}
|
||||||
else if (action == RimAction)
|
else if (action == RimAction)
|
||||||
{
|
{
|
||||||
target = rimHit;
|
target = rimHit;
|
||||||
back = rim;
|
back = rim;
|
||||||
|
|
||||||
drumSample.Rim.Play();
|
drumSample.Rim?.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target != null)
|
if (target != null)
|
||||||
|
@ -17,8 +17,18 @@ namespace osu.Game.Audio
|
|||||||
|
|
||||||
public SampleChannel GetChannel(SampleManager manager, string resourceNamespace = null)
|
public SampleChannel GetChannel(SampleManager manager, string resourceNamespace = null)
|
||||||
{
|
{
|
||||||
SampleChannel channel = manager.Get(Path.Combine("Gameplay", resourceNamespace ?? string.Empty, $"{Bank}-{Name}"));
|
SampleChannel channel = null;
|
||||||
channel.Volume.Value = Volume / 100.0;
|
|
||||||
|
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;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user