From fd7060e5c57953073fd2bdb99ddbc4aadfa3d7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=91=D0=B4=D0=BE=D1=80=20=D0=92=D0=B5=D1=81=D0=B5?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= Date: Wed, 25 Sep 2024 18:04:30 +0500 Subject: [PATCH] Zombie signal fix --- scenes/debug_lvl.tscn | 4 ++++ scenes/entities/Zombies/zombie.tscn | 2 +- scripts/components/zombies/AudioDamage.cs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scenes/debug_lvl.tscn b/scenes/debug_lvl.tscn index 45c3f1d..8bb653a 100644 --- a/scenes/debug_lvl.tscn +++ b/scenes/debug_lvl.tscn @@ -66,3 +66,7 @@ position = Vector2(848, 254) _line = 3 [connection signal="timeout" from="SunSpawner/Timer" to="SunSpawner" method="Spawn"] +[connection signal="OnHPChanged" from="Zombie" to="Zombie/AudioStreamPlayer2D" method="OnHPChanged"] +[connection signal="OnHPChanged" from="Zombie2" to="Zombie2/AudioStreamPlayer2D" method="OnHPChanged"] +[connection signal="OnHPChanged" from="Zombie3" to="Zombie3/AudioStreamPlayer2D" method="OnHPChanged"] +[connection signal="OnHPChanged" from="Zombie4" to="Zombie4/AudioStreamPlayer2D" method="OnHPChanged"] diff --git a/scenes/entities/Zombies/zombie.tscn b/scenes/entities/Zombies/zombie.tscn index c26b14e..07e9287 100644 --- a/scenes/entities/Zombies/zombie.tscn +++ b/scenes/entities/Zombies/zombie.tscn @@ -213,6 +213,6 @@ stream = ExtResource("8_di4dd") script = ExtResource("9_oxd1e") [connection signal="OnHPChanged" from="." to="CanvasGroup" method="DamageFlash"] -[connection signal="OnHPChanged" from="." to="AudioStreamPlayer2D" method="OnHPChanged"] +[connection signal="OnHPChanged" from="." to="AudioStreamPlayer2D" method="OnDamaged"] [connection signal="area_entered" from="Eatbox" to="Eatbox" method="OnAreaEntered"] [connection signal="area_exited" from="Eatbox" to="Eatbox" method="OnAreaExited"] diff --git a/scripts/components/zombies/AudioDamage.cs b/scripts/components/zombies/AudioDamage.cs index da814e7..30ac389 100644 --- a/scripts/components/zombies/AudioDamage.cs +++ b/scripts/components/zombies/AudioDamage.cs @@ -3,7 +3,7 @@ using System; public partial class AudioDamage : AudioStreamPlayer2D { - public void OnHPChanged(int amount) + public void OnDamaged(int amount) { Play(); }