Fix AudioStreamPlayer not resuming after returning to SceneTree

This commit is contained in:
Micky 2022-09-05 16:37:15 +02:00
parent 48cfa0da70
commit a7ce7b1d3f
3 changed files with 17 additions and 2 deletions

View file

@ -247,13 +247,18 @@ void AudioStreamPlayer3D::_notification(int p_what) {
if (autoplay && !Engine::get_singleton()->is_editor_hint()) {
play();
}
set_stream_paused(false);
} break;
case NOTIFICATION_EXIT_TREE: {
stop();
set_stream_paused(true);
AudioServer::get_singleton()->remove_listener_changed_callback(_listener_changed_cb, this);
} break;
case NOTIFICATION_PREDELETE: {
stop();
} break;
case NOTIFICATION_PAUSED: {
if (!can_process()) {
// Node can't process so we start fading out to silence.