weapon sway

This commit is contained in:
2022-04-10 13:52:40 +03:00
parent 210feaa48d
commit 377f6d1bf7
13 changed files with 427 additions and 195 deletions

View File

@@ -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");
}