Files
CalamityModPublic/Sounds/Custom/Scare.cs
T
2019-12-24 14:57:21 -06:00

21 lines
639 B
C#

using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
{
public class Scare : ModSound
{
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)
{
if (soundInstance.State == SoundState.Playing)
soundInstance.Stop();
soundInstance = sound.CreateInstance();
soundInstance.Volume = volume * 1f;
soundInstance.Pan = pan;
Main.PlaySoundInstance(soundInstance);
return soundInstance;
}
}
}