1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

Add priority to samples in a library

This commit is contained in:
Pedro J. Estébanez
2017-04-06 19:00:19 +02:00
parent 3916d964de
commit 9f8f8efa67
14 changed files with 116 additions and 17 deletions

View File

@@ -130,6 +130,7 @@ SpatialSamplePlayer::VoiceID SpatialSamplePlayer::play(const String &p_sample, i
Ref<Sample> sample = library->get_sample(p_sample);
float vol_change = library->sample_get_volume_db(p_sample);
float pitch_change = library->sample_get_pitch_scale(p_sample);
int priority = library->sample_get_priority(p_sample);
VoiceID vid = SpatialSoundServer::get_singleton()->source_play_sample(get_source_rid(), sample->get_rid(), sample->get_mix_rate() * pitch_change, p_voice);
if (vol_change)