rajouter des bus pour les différents audios
This commit is contained in:
@@ -14,11 +14,6 @@ func _ready() -> void:
|
||||
func _process(delta: float) -> void:
|
||||
if $AudioStreamPlayer2D.get_playback_position() != 0:
|
||||
GameState.float_thomas_music_position = $AudioStreamPlayer2D.get_playback_position()
|
||||
var stream : AudioStream = $AudioStreamPlayer2D.stream
|
||||
if stream:
|
||||
var l = stream.get_length()
|
||||
if is_zero_approx(l - GameState.float_thomas_music_position):
|
||||
play_next_song()
|
||||
|
||||
func _on_load_from_game_state() -> void:
|
||||
if GameState.float_thomas_music_position > 1:
|
||||
@@ -38,3 +33,6 @@ func play_next_song():
|
||||
|
||||
func _on_outside_unload_from_screen() -> void:
|
||||
$AudioStreamPlayer2D.stream_paused = true
|
||||
|
||||
func _on_audio_stream_player_2d_finished() -> void:
|
||||
play_next_song()
|
||||
|
||||
Reference in New Issue
Block a user