weapon sway
This commit is contained in:
@@ -82,20 +82,18 @@ namespace Game
|
||||
{
|
||||
// Check if this audio has multiple variations
|
||||
List<AudioClip> audioClips = new List<AudioClip>();
|
||||
int index = 1;
|
||||
do
|
||||
for (int i = 1; i<50; i++)
|
||||
{
|
||||
// TODO: make this more efficient, maybe get a list of assets and filter by name
|
||||
audioClip = Content.Load<AudioClip>(Path.Combine(audioBasePath, soundName + "_var" + index + ".flax"));
|
||||
if (audioClip != null)
|
||||
audioClips.Add(audioClip);
|
||||
index++;
|
||||
} while (audioClip != null);
|
||||
// TODO: make this more efficient, maybe get a list of assets and filter by name?
|
||||
AudioClip audioClipVariation = Content.Load<AudioClip>(Path.Combine(audioBasePath, soundName + "_var" + i + ".flax"));
|
||||
if (audioClipVariation == null)
|
||||
break;
|
||||
|
||||
audioClips.Add(audioClipVariation);
|
||||
}
|
||||
|
||||
if (audioClips.Count > 0)
|
||||
{
|
||||
audio.AudioClips = audioClips.ToArray();
|
||||
}
|
||||
else
|
||||
Console.PrintError("AudioClip '" + soundName + "' not found");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user