mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Add basic hitsound skinning
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user