2
0
Эх сурвалжийг харах

Merge pull request #83779 from AThousandShips/audio_pause

[Audio] Fix pausing stream on entering tree
Rémi Verschelde 1 жил өмнө
parent
commit
8f16d5f504

+ 1 - 1
scene/2d/audio_stream_player_2d.cpp

@@ -43,7 +43,7 @@ void AudioStreamPlayer2D::_notification(int p_what) {
 			if (autoplay && !Engine::get_singleton()->is_editor_hint()) {
 				play();
 			}
-			set_stream_paused(false);
+			set_stream_paused(!can_process());
 		} break;
 
 		case NOTIFICATION_EXIT_TREE: {

+ 1 - 1
scene/3d/audio_stream_player_3d.cpp

@@ -245,7 +245,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
 			if (autoplay && !Engine::get_singleton()->is_editor_hint()) {
 				play();
 			}
-			set_stream_paused(false);
+			set_stream_paused(!can_process());
 		} break;
 
 		case NOTIFICATION_EXIT_TREE: {

+ 1 - 1
scene/audio/audio_stream_player.cpp

@@ -40,7 +40,7 @@ void AudioStreamPlayer::_notification(int p_what) {
 			if (autoplay && !Engine::get_singleton()->is_editor_hint()) {
 				play();
 			}
-			set_stream_paused(false);
+			set_stream_paused(!can_process());
 		} break;
 
 		case NOTIFICATION_INTERNAL_PROCESS: {