feat: 添加生命值回复事件,组件,浮动文字
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user