feat: 添加玩家和敌人血条

This commit is contained in:
luke358
2026-05-18 15:46:44 +08:00
parent 2060719f4e
commit b6bf8ef5ba
12 changed files with 180 additions and 0 deletions
+13
View File
@@ -3,6 +3,8 @@
[ext_resource type="Texture2D" uid="uid://devt2xbk78rej" path="res://assets/sprites/shadow.png" id="1_fvc8g"]
[ext_resource type="Script" uid="uid://cwf3afjy6t6rg" path="res://scenes/unit/unit.gd" id="1_vh40f"]
[ext_resource type="PackedScene" uid="uid://bkyyic3okyjxx" path="res://scenes/components/hurtbox_component.tscn" id="3_vh40f"]
[ext_resource type="PackedScene" uid="uid://2ew7i6g3p0v8" path="res://scenes/components/health_component.tscn" id="4_bhlit"]
[ext_resource type="PackedScene" uid="uid://ifmw1e7gycc8" path="res://scenes/ui/health_bar/health_bar.tscn" id="5_vgvef"]
[sub_resource type="Animation" id="Animation_bhlit"]
length = 0.001
@@ -247,3 +249,14 @@ position = Vector2(0, -61)
libraries/ = SubResource("AnimationLibrary_w7udy")
[node name="HurtboxComponent" parent="." unique_id=1155790880 instance=ExtResource("3_vh40f")]
[node name="HealthComponent" parent="." unique_id=455886217 instance=ExtResource("4_bhlit")]
[node name="HealthBar" parent="." unique_id=1540037291 instance=ExtResource("5_vgvef")]
offset_left = -46.0
offset_top = -90.0
offset_right = 50.0
offset_bottom = -70.0
[connection signal="on_damaged" from="HurtboxComponent" to="." method="_on_hurtbox_component_on_damaged"]
[connection signal="on_health_changed" from="HealthComponent" to="HealthBar" method="_on_health_component_on_health_changed"]