rajouter des bus pour les différents audios
This commit is contained in:
@@ -103,7 +103,6 @@ position = Vector2(44, -38)
|
||||
[node name="FeetSound" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource("13_7opcx")
|
||||
autoplay = true
|
||||
stream_paused = true
|
||||
|
||||
[connection signal="start_intracting" from="." to="npcControler" method="_on_character_body_2d_start_intracting"]
|
||||
[connection signal="area_entered" from="detector" to="." method="_on_area_2d_area_entered"]
|
||||
|
||||
@@ -67,7 +67,7 @@ shape = SubResource("CapsuleShape2D_0816g")
|
||||
stream = ExtResource("3_redb5")
|
||||
volume_db = 1.0
|
||||
autoplay = true
|
||||
stream_paused = true
|
||||
bus = &"Music"
|
||||
playback_type = 1
|
||||
parameters/looping = false
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -99,7 +99,7 @@ can_walk_on_roads = true
|
||||
[node name="FeetSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("8_73an3")
|
||||
autoplay = true
|
||||
stream_paused = true
|
||||
bus = &"player_foot_step"
|
||||
playback_type = 1
|
||||
|
||||
[connection signal="loadFromGameState" from="." to="controleur" method="_on_character_body_2d_load_from_game_state"]
|
||||
|
||||
@@ -10,6 +10,7 @@ extends Node2D
|
||||
var can_interact_with : Node2D
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
print(human.get_feet_global_position())
|
||||
human.stop_interaction()
|
||||
human.velocityVector = Vector2(0, 0)
|
||||
human.wants_to_grab = false
|
||||
|
||||
Reference in New Issue
Block a user