Add basic hitsound skinning

This commit is contained in:
Dean Herbert
2018-02-22 17:34:35 +09:00
parent 84b707f4f8
commit 6ceabfe19e
3 changed files with 27 additions and 17 deletions

View File

@ -14,16 +14,16 @@ namespace osu.Game.Audio
public const string HIT_NORMAL = @"hitnormal";
public const string HIT_CLAP = @"hitclap";
public SampleChannel GetChannel(SampleManager manager, string resourceNamespace = null)
public SampleChannel GetChannel(Func<string, SampleChannel> getChannel, string resourceNamespace = null)
{
SampleChannel channel = null;
if (resourceNamespace != null)
channel = manager.Get($"Gameplay/{resourceNamespace}/{Bank}-{Name}");
channel = getChannel($"Gameplay/{resourceNamespace}/{Bank}-{Name}");
// try without namespace as a fallback.
if (channel == null)
channel = manager.Get($"Gameplay/{Bank}-{Name}");
channel = getChannel($"Gameplay/{Bank}-{Name}");
if (channel != null)
channel.Volume.Value = Volume / 100.0;