mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:03:08 +08:00
Simplify path construction
This commit is contained in:
parent
496b0fef01
commit
46ef17354e
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using osu.Framework.Audio.Sample;
|
||||
|
||||
namespace osu.Game.Audio
|
||||
@ -16,14 +17,7 @@ namespace osu.Game.Audio
|
||||
|
||||
public SampleChannel GetChannel(SampleManager manager, string resourceNamespace = null)
|
||||
{
|
||||
SampleChannel channel = null;
|
||||
|
||||
if (!string.IsNullOrEmpty(resourceNamespace))
|
||||
channel = manager.Get($"Gameplay/{resourceNamespace}/{Bank}-{Name}");
|
||||
|
||||
if (channel == null)
|
||||
channel = manager.Get($"Gameplay/{Bank}-{Name}");
|
||||
|
||||
SampleChannel channel = manager.Get(Path.Combine("Gameplay", resourceNamespace ?? string.Empty, $"{Bank}-{Name}"));
|
||||
channel.Volume.Value = Volume / 100.0;
|
||||
return channel;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user