feat: 添加生命值回复事件,组件,浮动文字

This commit is contained in:
luke358
2026-05-22 21:36:13 +08:00
parent 1cf4eeecc6
commit 2150fb8de8
6 changed files with 21 additions and 1 deletions
+4
View File
@@ -19,6 +19,7 @@ func _ready() -> void:
Global.on_create_block_text.connect(_on_create_block_text)
Global.on_create_damage_text.connect(_on_create_damage_text)
Global.on_upgrade_selected.connect(_on_upgrade_selected)
Global.on_create_heal_text.connect(_on_create_heal_text)
spawner.start_wave()
@@ -57,6 +58,9 @@ func _on_create_damage_text(unit: Node2D, hitbox: HitboxComponent) -> void:
var color := critical_color if hitbox.critical else normal_color
text.setup(str(hitbox.damage), color)
func _on_create_heal_text(unit: Node2D, heal: float) -> void:
var text := crteat_floating_text(unit)
text.setup("+ %s" % heal, hp_color)
func _on_upgrade_selected() -> void:
upgrade_panel.hide()