Пример #1
0
void AudioChannel::PlayRandomSample(const GuiSoundSet& soundSet, const float3& pos)
{
	if (soundSet.sounds.empty())
		return;

	const int soundIdx = guRNG.NextInt(soundSet.sounds.size());
	const int soundID = soundSet.getID(soundIdx);
	const float soundVol = soundSet.getVolume(soundIdx);

	PlaySample(soundID, pos, soundVol);
}
Пример #2
0
void AudioChannel::PlayRandomSample(const GuiSoundSet& soundSet, const float3& pos)
{
	const int soundIdx = soundSet.getRandomIdx();

	if (soundIdx < 0)
		return;

	const int soundID = soundSet.getID(soundIdx);
	const float soundVol = soundSet.getVolume(soundIdx);

	PlaySample(soundID, pos, soundVol);
}