SoundInstance API WIP
This commit is contained in:
@@ -13,13 +13,11 @@ namespace DaggerFramework.Audio
|
||||
// SOUND
|
||||
public abstract void PlaySound(Sound sound, string bus = "Master", float pitch = 1.0f, float volume = 1.0f);
|
||||
public void PlaySound(Sound sound, string bus = "Master") => PlaySound(sound, bus, default, default);
|
||||
public void PlaySoundVariation(Sound sound, string bus = "Master", float pitchVariation = 0.1f, float volume = 1.0f)
|
||||
{
|
||||
var maxPitch = 1.0f + pitchVariation;
|
||||
var minPitch = 1.0f - pitchVariation;
|
||||
|
||||
var pitch = (float)_random.NextDouble() * (maxPitch - minPitch) + minPitch;
|
||||
PlaySound(sound, bus, pitch, volume);
|
||||
public SoundInstance CreateInstance(Sound sound)
|
||||
{
|
||||
var instance = new SoundInstance(this, sound);
|
||||
return instance;
|
||||
}
|
||||
|
||||
// EFFECTS
|
||||
@@ -32,9 +30,4 @@ namespace DaggerFramework.Audio
|
||||
|
||||
private LehmerRandom _random = new LehmerRandom();
|
||||
}
|
||||
|
||||
public struct SoundInstance
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user