diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx index 6fad837..60de234 100644 --- a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx index 9c3046b..9fa99b3 100644 --- a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx index cbea38c..e885d51 100644 --- a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx Binary files differ diff --git a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn index 8554aa3..f7fe65a 100644 --- a/DungeonShooting_Godot/prefab/ui/RoomUI.tscn +++ b/DungeonShooting_Godot/prefab/ui/RoomUI.tscn @@ -1,15 +1,11 @@ -[gd_scene load_steps=14 format=3 uid="uid://bvpmtfupny8iu"] +[gd_scene load_steps=10 format=3 uid="uid://bvpmtfupny8iu"] [ext_resource type="Script" path="res://src/game/ui/roomUI/RoomUIPanel.cs" id="1_tfcrp"] [ext_resource type="Texture2D" uid="uid://b67i86mtqrn32" path="res://resource/sprite/ui/icon/icon_bullet.png" id="2_a2ohq"] [ext_resource type="Texture2D" uid="uid://dxstii6f4l8m0" path="res://resource/sprite/ui/keyboard/e.png" id="3_h7n2a"] [ext_resource type="Texture2D" uid="uid://cukrx5yyqw86o" path="res://resource/sprite/ui/reloadBar.png" id="4_nt6mj"] [ext_resource type="Texture2D" uid="uid://cx3i1nkcc4307" path="res://resource/sprite/ui/reloadBarBlock.png" id="5_wob8d"] -[ext_resource type="Texture2D" uid="uid://u5ul7fu8wv1a" path="res://resource/sprite/ui/healthBar.png" id="6_e4f48"] -[ext_resource type="Texture2D" uid="uid://djcdjrs07ighv" path="res://resource/sprite/ui/hpSlot.png" id="7_kk5l8"] -[ext_resource type="Texture2D" uid="uid://bxd75tme0v3pb" path="res://resource/sprite/ui/hpBar.png" id="8_j85pm"] -[ext_resource type="Texture2D" uid="uid://dnpguajopuyd7" path="res://resource/sprite/ui/shieldSlot.png" id="9_spw0e"] -[ext_resource type="Texture2D" uid="uid://h25j6uka74tv" path="res://resource/sprite/ui/shieldBar.png" id="10_8lm6q"] +[ext_resource type="Texture2D" uid="uid://blywnftxn1cfd" path="res://resource/sprite/ui/Life_full.png" id="11_y2dqd"] [ext_resource type="Texture2D" uid="uid://k621mhhkg65f" path="res://resource/sprite/ui/mapBar.png" id="11_yaqsk"] [ext_resource type="Texture2D" uid="uid://xafbhgrxmosy" path="res://resource/sprite/weapon/gun4.png" id="12_o2big"] @@ -67,54 +63,17 @@ offset_bottom = -20.0 mouse_filter = 2 -[node name="HealthBar" type="TextureRect" parent="Control"] -layout_mode = 0 -offset_right = 14.0 -offset_bottom = 14.0 +[node name="LifeBar" type="Control" parent="Control"] +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 scale = Vector2(4, 4) -texture = ExtResource("6_e4f48") -[node name="HpSlot" type="NinePatchRect" parent="Control/HealthBar"] -layout_mode = 0 -offset_left = 13.0 -offset_top = 1.0 -offset_right = 66.0 -offset_bottom = 9.0 -texture = ExtResource("7_kk5l8") -patch_margin_left = 1 -patch_margin_top = 1 -patch_margin_right = 2 -patch_margin_bottom = 1 - -[node name="HpBar" type="TextureRect" parent="Control/HealthBar/HpSlot"] -layout_mode = 0 -offset_left = 1.0 -offset_top = 2.0 -offset_right = 51.0 -offset_bottom = 6.0 -texture = ExtResource("8_j85pm") -expand_mode = 1 - -[node name="ShieldSlot" type="NinePatchRect" parent="Control/HealthBar"] -layout_mode = 0 -offset_left = 13.0 -offset_top = 8.0 -offset_right = 65.0 -offset_bottom = 13.0 -texture = ExtResource("9_spw0e") -patch_margin_left = 1 -patch_margin_top = 1 -patch_margin_right = 1 -patch_margin_bottom = 1 - -[node name="ShieldBar" type="TextureRect" parent="Control/HealthBar/ShieldSlot"] -layout_mode = 0 -offset_left = 1.0 -offset_top = 1.0 -offset_right = 51.0 -offset_bottom = 4.0 -texture = ExtResource("10_8lm6q") -expand_mode = 1 +[node name="Life" type="TextureRect" parent="Control/LifeBar"] +layout_mode = 2 +offset_right = 12.0 +offset_bottom = 10.0 +texture = ExtResource("11_y2dqd") [node name="MapBar" type="TextureRect" parent="Control"] layout_mode = 1 diff --git a/DungeonShooting_Godot/resource/sprite/ui/Life_empty.png b/DungeonShooting_Godot/resource/sprite/ui/Life_empty.png new file mode 100644 index 0000000..855185f --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Life_empty.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/Life_empty.png.import b/DungeonShooting_Godot/resource/sprite/ui/Life_empty.png.import new file mode 100644 index 0000000..fbd6452 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Life_empty.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dv3qskyc0dcmy" +path="res://.godot/imported/Life_empty.png-0adf786e78d4b12d461b0eb1e1990e81.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/Life_empty.png" +dest_files=["res://.godot/imported/Life_empty.png-0adf786e78d4b12d461b0eb1e1990e81.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/sprite/ui/Life_full.png b/DungeonShooting_Godot/resource/sprite/ui/Life_full.png new file mode 100644 index 0000000..983b566 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Life_full.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/Life_full.png.import b/DungeonShooting_Godot/resource/sprite/ui/Life_full.png.import new file mode 100644 index 0000000..faffa5c --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Life_full.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://blywnftxn1cfd" +path="res://.godot/imported/Life_full.png-fb9a520bfad66b139d42ac2f023ffc04.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/Life_full.png" +dest_files=["res://.godot/imported/Life_full.png-fb9a520bfad66b139d42ac2f023ffc04.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/sprite/ui/Life_half.png b/DungeonShooting_Godot/resource/sprite/ui/Life_half.png new file mode 100644 index 0000000..581f4a2 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Life_half.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/Life_half.png.import b/DungeonShooting_Godot/resource/sprite/ui/Life_half.png.import new file mode 100644 index 0000000..e672f04 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Life_half.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cnnl07abi51ph" +path="res://.godot/imported/Life_half.png-db960c6dc9d158324f8b8c8db8be7d36.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/Life_half.png" +dest_files=["res://.godot/imported/Life_half.png-db960c6dc9d158324f8b8c8db8be7d36.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/sprite/ui/Shield_empty.png b/DungeonShooting_Godot/resource/sprite/ui/Shield_empty.png new file mode 100644 index 0000000..f9c435e --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Shield_empty.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/Shield_empty.png.import b/DungeonShooting_Godot/resource/sprite/ui/Shield_empty.png.import new file mode 100644 index 0000000..f8a3413 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Shield_empty.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://jtg0wkxir2w4" +path="res://.godot/imported/Shield_empty.png-9ad07f3ce895c2829d28d6052a42461b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/Shield_empty.png" +dest_files=["res://.godot/imported/Shield_empty.png-9ad07f3ce895c2829d28d6052a42461b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/sprite/ui/Shield_full.png b/DungeonShooting_Godot/resource/sprite/ui/Shield_full.png new file mode 100644 index 0000000..ed0095b --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Shield_full.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/Shield_full.png.import b/DungeonShooting_Godot/resource/sprite/ui/Shield_full.png.import new file mode 100644 index 0000000..8c57956 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/Shield_full.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bhr8n3ytchbqi" +path="res://.godot/imported/Shield_full.png-5036f32a904683d2e732c6d6d0e7c23d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/Shield_full.png" +dest_files=["res://.godot/imported/Shield_full.png-5036f32a904683d2e732c6d6d0e7c23d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index 56e77b8..96a202a 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -352,7 +352,7 @@ [sub_resource type="ImageTexture" id="58"] -[sub_resource type="Image" id="Image_xsxlr"] +[sub_resource type="Image" id="Image_4706p"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -362,7 +362,7 @@ } [sub_resource type="ImageTexture" id="60"] -image = SubResource("Image_xsxlr") +image = SubResource("Image_4706p") [sub_resource type="StyleBoxTexture" id="61"] content_margin_left = 2.0 @@ -372,7 +372,7 @@ texture = SubResource("60") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_6k4hq"] +[sub_resource type="Image" id="Image_nsxh3"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -382,7 +382,7 @@ } [sub_resource type="ImageTexture" id="63"] -image = SubResource("Image_6k4hq") +image = SubResource("Image_nsxh3") [sub_resource type="StyleBoxTexture" id="64"] content_margin_left = 2.0 @@ -392,7 +392,7 @@ texture = SubResource("63") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_ty5bn"] +[sub_resource type="Image" id="Image_gfwfr"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -402,7 +402,7 @@ } [sub_resource type="ImageTexture" id="66"] -image = SubResource("Image_ty5bn") +image = SubResource("Image_gfwfr") [sub_resource type="StyleBoxTexture" id="67"] content_margin_left = 2.0 @@ -412,7 +412,7 @@ texture = SubResource("66") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_pggrv"] +[sub_resource type="Image" id="Image_3jjwj"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -422,7 +422,7 @@ } [sub_resource type="ImageTexture" id="69"] -image = SubResource("Image_pggrv") +image = SubResource("Image_3jjwj") [sub_resource type="StyleBoxTexture" id="70"] content_margin_left = 0.0 @@ -446,7 +446,7 @@ content_margin_right = 4.0 content_margin_bottom = 4.0 -[sub_resource type="Image" id="Image_x6cp0"] +[sub_resource type="Image" id="Image_frx48"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -456,7 +456,7 @@ } [sub_resource type="ImageTexture" id="56"] -image = SubResource("Image_x6cp0") +image = SubResource("Image_frx48") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 diff --git a/DungeonShooting_Godot/src/framework/IClone.cs b/DungeonShooting_Godot/src/framework/IClone.cs new file mode 100644 index 0000000..f14feb6 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/IClone.cs @@ -0,0 +1,8 @@ + +public interface IClone +{ + /// + /// 克隆当前对象 + /// + T Clone(); +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/IUiNode.cs b/DungeonShooting_Godot/src/framework/ui/IUiNode.cs index bf384b7..7e20a13 100644 --- a/DungeonShooting_Godot/src/framework/ui/IUiNode.cs +++ b/DungeonShooting_Godot/src/framework/ui/IUiNode.cs @@ -6,7 +6,7 @@ /// /// Godot中的节点类型 /// 克隆该对象返回的类型 -public abstract class IUiNode where TNodeType : Node +public abstract class IUiNode : IClone where TNodeType : Node { /// /// Godot节点实例 diff --git a/DungeonShooting_Godot/src/framework/ui/grid/UiCell.cs b/DungeonShooting_Godot/src/framework/ui/grid/UiCell.cs new file mode 100644 index 0000000..2870ffa --- /dev/null +++ b/DungeonShooting_Godot/src/framework/ui/grid/UiCell.cs @@ -0,0 +1,29 @@ + +using Godot; + +public abstract class UiCell : IDestroy where TNodeType : Node where TUiNodeType : IUiNode +{ + public bool IsDestroyed { get; private set; } + + public UiGrid Grid { get; set; } + public TUiNodeType CellNode { get; set; } + public T Data { get; set; } + + public virtual void OnInit() + { + } + + public virtual void OnSetData(T data) + { + } + + public void Destroy() + { + if (IsDestroyed) + { + return; + } + + IsDestroyed = true; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs b/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs new file mode 100644 index 0000000..2f7ef01 --- /dev/null +++ b/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs @@ -0,0 +1,113 @@ + + +using System; +using System.Collections.Generic; +using Godot; + +public partial class UiGrid : GridContainer, IDestroy where TNodeType : Node where TUiNodeType : IUiNode +{ + public bool IsDestroyed { get; private set; } + private TUiNodeType _template; + private Node _parent; + private Type _cellType; + private Stack> _cellPool = new Stack>(); + private List> _cellList = new List>(); + + public UiGrid(TUiNodeType template, Type cellType, int columns, int offsetX, int offsetY) + { + _template = template; + _cellType = cellType; + _parent = _template.Instance.GetParent(); + _parent.RemoveChild(_template.Instance); + _parent.AddChild(this); + Columns = columns; + AddThemeConstantOverride("h_separation", offsetX); + AddThemeConstantOverride("v_separation", offsetY); + } + + public override void _Ready() + { + if (_template.Instance is Control control) + { + Position = control.Position; + } + } + + public void SetDataList(TData[] array) + { + if (array.Length > _cellList.Count) + { + do + { + var cell = GetCellInstance(); + _cellList.Add(cell); + AddChild(cell.CellNode.Instance); + } while (array.Length > _cellList.Count); + } + else if(array.Length < _cellList.Count) + { + do + { + var cell = _cellList[_cellList.Count - 1]; + _cellList.RemoveAt(_cellList.Count - 1); + ReclaimCellInstance(cell); + } while (array.Length < _cellList.Count); + } + + for (var i = 0; i < _cellList.Count; i++) + { + var data = array[i]; + _cellList[i].OnSetData(data); + } + } + + public void Add(TData data) + { + var cell = GetCellInstance(); + _cellList.Add(cell); + AddChild(cell.CellNode.Instance); + cell.OnSetData(data); + } + + public void Destroy() + { + if (IsDestroyed) + { + return; + } + + IsDestroyed = true; + + for (var i = 0; i < _cellList.Count; i++) + { + _cellList[i].Destroy(); + } + foreach (var uiCell in _cellPool) + { + uiCell.Destroy(); + } + _cellList = null; + _cellPool = null; + } + + private UiCell GetCellInstance() + { + if (_cellPool.Count > 0) + { + return _cellPool.Pop(); + } + + var cell = Activator.CreateInstance(_cellType); + var uiCell = (UiCell)cell; + uiCell.CellNode = _template.Clone(); + uiCell.Grid = this; + uiCell.OnInit(); + return uiCell; + } + + private void ReclaimCellInstance(UiCell cell) + { + RemoveChild(cell.CellNode.Instance); + _cellPool.Push(cell); + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/buff/State.cs b/DungeonShooting_Godot/src/game/buff/State.cs new file mode 100644 index 0000000..cca36d1 --- /dev/null +++ b/DungeonShooting_Godot/src/game/buff/State.cs @@ -0,0 +1,5 @@ + +public class State +{ + +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index e4e5b35..1c9126a 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -28,6 +28,8 @@ public const string prefab_role_Role0001_tscn = "res://prefab/role/Role0001.tscn"; public const string prefab_role_RoleTemplate_tscn = "res://prefab/role/RoleTemplate.tscn"; public const string prefab_shell_Shell0001_tscn = "res://prefab/shell/Shell0001.tscn"; + public const string prefab_shell_Shell0002_tscn = "res://prefab/shell/Shell0002.tscn"; + public const string prefab_shell_Shell0003_tscn = "res://prefab/shell/Shell0003.tscn"; public const string prefab_test_MoveComponent_tscn = "res://prefab/test/MoveComponent.tscn"; public const string prefab_test_TestActivity_tscn = "res://prefab/test/TestActivity.tscn"; public const string prefab_ui_EditorTools_tscn = "res://prefab/ui/EditorTools.tscn"; @@ -58,22 +60,22 @@ public const string resource_material_Blend_tres = "res://resource/material/Blend.tres"; public const string resource_material_SmokeParticleMaterial_tres = "res://resource/material/SmokeParticleMaterial.tres"; public const string resource_sound_bgm_Intro_ogg = "res://resource/sound/bgm/Intro.ogg"; - public const string resource_sound_sfx_equip_Equip0001_ogg = "res://resource/sound/sfx/equip/Equip0001.ogg"; - public const string resource_sound_sfx_equip_Equip0002_ogg = "res://resource/sound/sfx/equip/Equip0002.ogg"; - public const string resource_sound_sfx_equip_Equip0003_ogg = "res://resource/sound/sfx/equip/Equip0003.ogg"; - public const string resource_sound_sfx_equip_Equip0004_ogg = "res://resource/sound/sfx/equip/Equip0004.ogg"; - public const string resource_sound_sfx_equip_Equip0005_ogg = "res://resource/sound/sfx/equip/Equip0005.ogg"; - public const string resource_sound_sfx_equip_Equip0006_ogg = "res://resource/sound/sfx/equip/Equip0006.ogg"; - public const string resource_sound_sfx_equip_Equip0007_ogg = "res://resource/sound/sfx/equip/Equip0007.ogg"; - public const string resource_sound_sfx_equip_Equip0008_ogg = "res://resource/sound/sfx/equip/Equip0008.ogg"; - public const string resource_sound_sfx_equip_Equip0009_ogg = "res://resource/sound/sfx/equip/Equip0009.ogg"; - public const string resource_sound_sfx_equip_Equip0010_ogg = "res://resource/sound/sfx/equip/Equip0010.ogg"; - public const string resource_sound_sfx_equip_Equip0011_ogg = "res://resource/sound/sfx/equip/Equip0011.ogg"; - public const string resource_sound_sfx_equip_Equip0012_ogg = "res://resource/sound/sfx/equip/Equip0012.ogg"; - public const string resource_sound_sfx_equip_Equip0013_ogg = "res://resource/sound/sfx/equip/Equip0013.ogg"; - public const string resource_sound_sfx_equip_Equip0014_ogg = "res://resource/sound/sfx/equip/Equip0014.ogg"; - public const string resource_sound_sfx_equip_Equip0015_ogg = "res://resource/sound/sfx/equip/Equip0015.ogg"; - public const string resource_sound_sfx_equip_Equip0016_ogg = "res://resource/sound/sfx/equip/Equip0016.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0001_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0001.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0002_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0002.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0003_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0003.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0004_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0004.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0005_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0005.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0006_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0006.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0007_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0007.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0008_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0008.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0009_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0009.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0010_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0010.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0011_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0011.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0012_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0012.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0013_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0013.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0014_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0014.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0015_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0015.ogg"; + public const string resource_sound_sfx_beLoaded_BeLoaded0016_ogg = "res://resource/sound/sfx/beLoaded/BeLoaded0016.ogg"; public const string resource_sound_sfx_explosion_Explosion0001_ogg = "res://resource/sound/sfx/explosion/Explosion0001.ogg"; public const string resource_sound_sfx_explosion_Explosion0002_ogg = "res://resource/sound/sfx/explosion/Explosion0002.ogg"; public const string resource_sound_sfx_explosion_Explosion0003_ogg = "res://resource/sound/sfx/explosion/Explosion0003.ogg"; @@ -124,7 +126,9 @@ public const string resource_sprite_role_role9_png = "res://resource/sprite/role/role9.png"; public const string resource_sprite_role_enemy0001_Enemy0001_png = "res://resource/sprite/role/enemy0001/Enemy0001.png"; public const string resource_sprite_role_enemy0001_Enemy0001_Debris_png = "res://resource/sprite/role/enemy0001/Enemy0001_Debris.png"; - public const string resource_sprite_shell_shellCase_png = "res://resource/sprite/shell/shellCase.png"; + public const string resource_sprite_shell_Shell0001_png = "res://resource/sprite/shell/Shell0001.png"; + public const string resource_sprite_shell_Shell0002_png = "res://resource/sprite/shell/Shell0002.png"; + public const string resource_sprite_shell_Shell0003_png = "res://resource/sprite/shell/Shell0003.png"; public const string resource_sprite_ui_CursorCenter_png = "res://resource/sprite/ui/CursorCenter.png"; public const string resource_sprite_ui_cursors_png = "res://resource/sprite/ui/cursors.png"; public const string resource_sprite_ui_font_bg_png = "res://resource/sprite/ui/font_bg.png"; @@ -132,12 +136,17 @@ public const string resource_sprite_ui_healthBar_png = "res://resource/sprite/ui/healthBar.png"; public const string resource_sprite_ui_hpBar_png = "res://resource/sprite/ui/hpBar.png"; public const string resource_sprite_ui_hpSlot_png = "res://resource/sprite/ui/hpSlot.png"; + public const string resource_sprite_ui_Life_empty_png = "res://resource/sprite/ui/Life_empty.png"; + public const string resource_sprite_ui_Life_full_png = "res://resource/sprite/ui/Life_full.png"; + public const string resource_sprite_ui_Life_half_png = "res://resource/sprite/ui/Life_half.png"; public const string resource_sprite_ui_mapBar_png = "res://resource/sprite/ui/mapBar.png"; public const string resource_sprite_ui_reloadBar_png = "res://resource/sprite/ui/reloadBar.png"; public const string resource_sprite_ui_reloadBarBlock_png = "res://resource/sprite/ui/reloadBarBlock.png"; public const string resource_sprite_ui_RoomUi_png = "res://resource/sprite/ui/RoomUi.png"; public const string resource_sprite_ui_shieldBar_png = "res://resource/sprite/ui/shieldBar.png"; public const string resource_sprite_ui_shieldSlot_png = "res://resource/sprite/ui/shieldSlot.png"; + public const string resource_sprite_ui_Shield_empty_png = "res://resource/sprite/ui/Shield_empty.png"; + public const string resource_sprite_ui_Shield_full_png = "res://resource/sprite/ui/Shield_full.png"; public const string resource_sprite_ui_templateui_png = "res://resource/sprite/ui/template-ui.png"; public const string resource_sprite_ui_icon_icon_bullet_png = "res://resource/sprite/ui/icon/icon_bullet.png"; public const string resource_sprite_ui_icon_icon_pickup_png = "res://resource/sprite/ui/icon/icon_pickup.png"; @@ -167,6 +176,8 @@ public const string resource_spriteFrames_RoomDoor_EW_tres = "res://resource/spriteFrames/RoomDoor_EW.tres"; public const string resource_spriteFrames_RoomDoor_NS_tres = "res://resource/spriteFrames/RoomDoor_NS.tres"; public const string resource_spriteFrames_Shell0001_tres = "res://resource/spriteFrames/Shell0001.tres"; + public const string resource_spriteFrames_Shell0002_tres = "res://resource/spriteFrames/Shell0002.tres"; + public const string resource_spriteFrames_Shell0003_tres = "res://resource/spriteFrames/Shell0003.tres"; public const string resource_spriteFrames_Weapon0001_tres = "res://resource/spriteFrames/Weapon0001.tres"; public const string resource_spriteFrames_Weapon0002_tres = "res://resource/spriteFrames/Weapon0002.tres"; public const string resource_spriteFrames_Weapon0003_tres = "res://resource/spriteFrames/Weapon0003.tres"; diff --git a/DungeonShooting_Godot/src/game/role/Player.cs b/DungeonShooting_Godot/src/game/role/Player.cs index de9542c..68ab896 100644 --- a/DungeonShooting_Godot/src/game/role/Player.cs +++ b/DungeonShooting_Godot/src/game/role/Player.cs @@ -47,10 +47,10 @@ // MainCamera.Main.ResetSmoothing(); // remoteTransform.RemotePath = remoteTransform.GetPathTo(MainCamera.Main); - MaxHp = 50; - Hp = 50; - MaxShield = 30; - Shield = 30; + MaxHp = 6; + Hp = 6; + MaxShield = 2; + Shield = 2; // debug用 // Acceleration = 3000; @@ -141,6 +141,12 @@ PlayAnim(); } + protected override int OnHandlerHurt(int damage) + { + //修改受到的伤害, 每次只受到1点伤害 + return 1; + } + protected override void OnChangeHp(int hp) { //GameApplication.Instance.Ui.SetHp(hp); diff --git a/DungeonShooting_Godot/src/game/role/Role.cs b/DungeonShooting_Godot/src/game/role/Role.cs index 79ca40f..e249c99 100644 --- a/DungeonShooting_Godot/src/game/role/Role.cs +++ b/DungeonShooting_Godot/src/game/role/Role.cs @@ -200,6 +200,15 @@ } /// + /// 受到伤害时调用, 用于改变受到的伤害值 + /// + /// 受到的伤害 + protected virtual int OnHandlerHurt(int damage) + { + return damage; + } + + /// /// 当可互动的物体改变时调用, result 参数为 null 表示变为不可互动 /// /// 检测是否可互动时的返回值 @@ -506,6 +515,12 @@ /// 角度 public virtual void Hurt(int damage, float angle) { + damage = OnHandlerHurt(damage); + if (damage <= 0) + { + return; + } + OnHit(damage); if (Shield > 0) { diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index b8d3ed1..f84968b 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -163,7 +163,7 @@ //打开游戏中的ui var roomUi = UiManager.Open_RoomUI(); - roomUi.InitData(player); + roomUi.InitData(); //派发进入地牢事件 EventManager.EmitEvent(EventEnum.OnEnterDungeon); diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/HealthBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/HealthBar.cs deleted file mode 100644 index 0f387b1..0000000 --- a/DungeonShooting_Godot/src/game/ui/roomUI/HealthBar.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using Godot; - -namespace UI.RoomUI; - -public class HealthBar -{ - private RoomUI.UiNode_HealthBar _healthBar; - // 当前血量 - private int _hp; - // 最大血量 - private int _maxHp; - // 当前护盾值 - private int _shield; - // 最大护盾值 - private int _maxShield; - - private EventFactory _eventFactory; - - public HealthBar(RoomUI.UiNode_HealthBar healthBar) - { - _healthBar = healthBar; - } - - public void OnShow() - { - _eventFactory = EventManager.CreateEventFactory(); - _eventFactory.AddEventListener(EventEnum.OnPlayerHpChange, OnPlayerHpChange); - _eventFactory.AddEventListener(EventEnum.OnPlayerMaxHpChange, OnPlayerMaxHpChange); - _eventFactory.AddEventListener(EventEnum.OnPlayerShieldChange, OnPlayerShieldChange); - _eventFactory.AddEventListener(EventEnum.OnPlayerMaxShieldChange, OnPlayerMaxShieldChange); - } - - public void OnHide() - { - _eventFactory.RemoveAllEventListener(); - } - - /// - /// 设置最大血量 - /// - public void SetMaxHp(int maxHp) - { - _maxHp = Mathf.Max(maxHp, 0); - _healthBar.L_HpSlot.Instance.Size = new Vector2(maxHp + 3, _healthBar.L_HpSlot.Instance.Size.Y); - if (_hp > maxHp) - { - SetHp(maxHp); - } - } - - /// - /// 设置最大护盾值 - /// - public void SetMaxShield(int maxShield) - { - _maxShield = Mathf.Max(maxShield, 0); - _healthBar.L_ShieldSlot.Instance.Size = new Vector2(maxShield + 2, _healthBar.L_ShieldSlot.Instance.Size.Y); - if (_shield > _maxShield) - { - SetShield(maxShield); - } - } - - /// - /// 设置当前血量 - /// - public void SetHp(int hp) - { - _hp = Mathf.Clamp(hp, 0, _maxHp); - var textureRect = _healthBar.L_HpSlot.L_HpBar.Instance; - textureRect.Size = new Vector2(hp, textureRect.Size.Y); - } - - /// - /// 设置护盾值 - /// - public void SetShield(int shield) - { - _shield = Mathf.Clamp(shield, 0, _maxShield); - var textureRect = _healthBar.L_ShieldSlot.L_ShieldBar.Instance; - textureRect.Size = new Vector2(shield, textureRect.Size.Y); - } - - private void OnPlayerHpChange(object o) - { - SetHp(Convert.ToInt32(o)); - } - - private void OnPlayerMaxHpChange(object o) - { - SetMaxHp(Convert.ToInt32(o)); - } - - private void OnPlayerShieldChange(object o) - { - SetShield(Convert.ToInt32(o)); - } - - private void OnPlayerMaxShieldChange(object o) - { - SetMaxShield(Convert.ToInt32(o)); - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/LifeBar.cs b/DungeonShooting_Godot/src/game/ui/roomUI/LifeBar.cs new file mode 100644 index 0000000..1b9df3c --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/roomUI/LifeBar.cs @@ -0,0 +1,98 @@ +using System.Collections.Generic; +using Godot; + +namespace UI.RoomUI; + +public class LifeBar +{ + + private RoomUI.UiNode_LifeBar _bar; + private UiGrid _grid; + private EventFactory _eventFactory; + private bool _refreshFlag = false; + + public LifeBar(RoomUI.UiNode_LifeBar lifeBar) + { + _bar = lifeBar; + var uiNodeLife = lifeBar.L_Life; + + _grid = new UiGrid(uiNodeLife, typeof(LifeCell), 20, 1, 2); + + + // _grid.Add(LifeIconEnum.FullHeart); + // _grid.Add(LifeIconEnum.HalfHeart); + // _grid.Add(LifeIconEnum.EmptyHeart); + // _grid.Add(LifeIconEnum.FullShield); + // _grid.Add(LifeIconEnum.EmptyShield); + } + + public void OnShow() + { + _eventFactory = EventManager.CreateEventFactory(); + _eventFactory.AddEventListener(EventEnum.OnPlayerHpChange, o => RefreshLife()); + _eventFactory.AddEventListener(EventEnum.OnPlayerMaxHpChange, o => RefreshLife()); + _eventFactory.AddEventListener(EventEnum.OnPlayerShieldChange, o => RefreshLife()); + _eventFactory.AddEventListener(EventEnum.OnPlayerMaxShieldChange, o => RefreshLife()); + } + + public void OnHide() + { + _eventFactory.RemoveAllEventListener(); + } + + public void Process(float delta) + { + if (_refreshFlag) + { + _refreshFlag = false; + HandlerRefreshLife(); + } + } + + public void RefreshLife() + { + _refreshFlag = true; + } + + private void HandlerRefreshLife() + { + var player = Player.Current; + if (player.MaxHp % 2 != 0) + { + GD.PrintErr("玩家血量不是偶数!"); + } + + var list = new List(); + for (var i = 0; i < player.MaxHp / 2; i++) + { + if (player.Hp >= i * 2 + 2) + { + list.Add(LifeIconEnum.FullHeart); + } + else if (player.Hp >= i * 2 + 1) + { + list.Add(LifeIconEnum.HalfHeart); + } + else + { + list.Add(LifeIconEnum.EmptyHeart); + } + } + + for (var i = 0; i < player.MaxShield; i++) + { + if (player.Shield >= i + 1) + { + list.Add(LifeIconEnum.FullShield); + } + else + { + list.Add(LifeIconEnum.EmptyShield); + } + } + + //var maxHp + _grid.SetDataList(list.ToArray()); + } + +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/LifeCell.cs b/DungeonShooting_Godot/src/game/ui/roomUI/LifeCell.cs new file mode 100644 index 0000000..c08cd65 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/roomUI/LifeCell.cs @@ -0,0 +1,36 @@ +using Godot; + +namespace UI.RoomUI; + +public class LifeCell : UiCell +{ + private int _type = -1; + + public override void OnSetData(LifeIconEnum data) + { + if (_type == (int)data) + { + return; + } + + _type = (int)data; + switch (data) + { + case LifeIconEnum.FullHeart: + CellNode.Instance.Texture = ResourceManager.Load(ResourcePath.resource_sprite_ui_Life_full_png); + break; + case LifeIconEnum.HalfHeart: + CellNode.Instance.Texture = ResourceManager.Load(ResourcePath.resource_sprite_ui_Life_half_png); + break; + case LifeIconEnum.EmptyHeart: + CellNode.Instance.Texture = ResourceManager.Load(ResourcePath.resource_sprite_ui_Life_empty_png); + break; + case LifeIconEnum.FullShield: + CellNode.Instance.Texture = ResourceManager.Load(ResourcePath.resource_sprite_ui_Shield_full_png); + break; + case LifeIconEnum.EmptyShield: + CellNode.Instance.Texture = ResourceManager.Load(ResourcePath.resource_sprite_ui_Shield_empty_png); + break; + } + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/LifeIconEnum.cs b/DungeonShooting_Godot/src/game/ui/roomUI/LifeIconEnum.cs new file mode 100644 index 0000000..a2677cc --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/roomUI/LifeIconEnum.cs @@ -0,0 +1,25 @@ +namespace UI.RoomUI; + +public enum LifeIconEnum +{ + /// + /// 满心 + /// + FullHeart, + /// + /// 半心 + /// + HalfHeart, + /// + /// 空心 + /// + EmptyHeart, + /// + /// 满护盾 + /// + FullShield, + /// + /// 空护盾 + /// + EmptyShield, +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs index 042949b..f461396 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUI.cs @@ -178,100 +178,34 @@ } /// - /// 类型: , 路径: RoomUI.Control.HealthBar.HpSlot.HpBar + /// 类型: , 路径: RoomUI.Control.LifeBar.Life /// - public class UiNode_HpBar : IUiNode + public class UiNode_Life : IUiNode { - public UiNode_HpBar(Godot.TextureRect node) : base(node) { } - public override UiNode_HpBar Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public UiNode_Life(Godot.TextureRect node) : base(node) { } + public override UiNode_Life Clone() => new ((Godot.TextureRect)Instance.Duplicate()); } /// - /// 类型: , 路径: RoomUI.Control.HealthBar.HpSlot + /// 类型: , 路径: RoomUI.Control.LifeBar /// - public class UiNode_HpSlot : IUiNode + public class UiNode_LifeBar : IUiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.HealthBar.HpBar + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.Life /// - public UiNode_HpBar L_HpBar + public UiNode_Life L_Life { get { - if (_L_HpBar == null) _L_HpBar = new UiNode_HpBar(Instance.GetNodeOrNull("HpBar")); - return _L_HpBar; + if (_L_Life == null) _L_Life = new UiNode_Life(Instance.GetNodeOrNull("Life")); + return _L_Life; } } - private UiNode_HpBar _L_HpBar; + private UiNode_Life _L_Life; - public UiNode_HpSlot(Godot.NinePatchRect node) : base(node) { } - public override UiNode_HpSlot Clone() => new ((Godot.NinePatchRect)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: RoomUI.Control.HealthBar.ShieldSlot.ShieldBar - /// - public class UiNode_ShieldBar : IUiNode - { - public UiNode_ShieldBar(Godot.TextureRect node) : base(node) { } - public override UiNode_ShieldBar Clone() => new ((Godot.TextureRect)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: RoomUI.Control.HealthBar.ShieldSlot - /// - public class UiNode_ShieldSlot : IUiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.HealthBar.ShieldBar - /// - public UiNode_ShieldBar L_ShieldBar - { - get - { - if (_L_ShieldBar == null) _L_ShieldBar = new UiNode_ShieldBar(Instance.GetNodeOrNull("ShieldBar")); - return _L_ShieldBar; - } - } - private UiNode_ShieldBar _L_ShieldBar; - - public UiNode_ShieldSlot(Godot.NinePatchRect node) : base(node) { } - public override UiNode_ShieldSlot Clone() => new ((Godot.NinePatchRect)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: RoomUI.Control.HealthBar - /// - public class UiNode_HealthBar : IUiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.HpSlot - /// - public UiNode_HpSlot L_HpSlot - { - get - { - if (_L_HpSlot == null) _L_HpSlot = new UiNode_HpSlot(Instance.GetNodeOrNull("HpSlot")); - return _L_HpSlot; - } - } - private UiNode_HpSlot _L_HpSlot; - - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.Control.ShieldSlot - /// - public UiNode_ShieldSlot L_ShieldSlot - { - get - { - if (_L_ShieldSlot == null) _L_ShieldSlot = new UiNode_ShieldSlot(Instance.GetNodeOrNull("ShieldSlot")); - return _L_ShieldSlot; - } - } - private UiNode_ShieldSlot _L_ShieldSlot; - - public UiNode_HealthBar(Godot.TextureRect node) : base(node) { } - public override UiNode_HealthBar Clone() => new ((Godot.TextureRect)Instance.Duplicate()); + public UiNode_LifeBar(Godot.Control node) : base(node) { } + public override UiNode_LifeBar Clone() => new ((Godot.Control)Instance.Duplicate()); } /// @@ -342,17 +276,17 @@ public class UiNode_Control : IUiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.HealthBar + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.LifeBar /// - public UiNode_HealthBar L_HealthBar + public UiNode_LifeBar L_LifeBar { get { - if (_L_HealthBar == null) _L_HealthBar = new UiNode_HealthBar(Instance.GetNodeOrNull("HealthBar")); - return _L_HealthBar; + if (_L_LifeBar == null) _L_LifeBar = new UiNode_LifeBar(Instance.GetNodeOrNull("LifeBar")); + return _L_LifeBar; } } - private UiNode_HealthBar _L_HealthBar; + private UiNode_LifeBar _L_LifeBar; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: RoomUI.MapBar diff --git a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUIPanel.cs b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUIPanel.cs index 795c3e7..7401d92 100644 --- a/DungeonShooting_Godot/src/game/ui/roomUI/RoomUIPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/roomUI/RoomUIPanel.cs @@ -1,5 +1,4 @@ -using System.Collections; using Godot; namespace UI.RoomUI; @@ -11,43 +10,41 @@ { private ReloadBar _reloadBar; private InteractiveTipBar _interactiveTipBar; - private HealthBar _healthBar; private GunBar _gunBar; + private LifeBar _lifeBar; public override void OnCreateUi() { _reloadBar = new ReloadBar(L_ReloadBar); _interactiveTipBar = new InteractiveTipBar(L_InteractiveTipBar); - _healthBar = new HealthBar(L_Control.L_HealthBar); _gunBar = new GunBar(L_Control.L_GunBar); + _lifeBar = new LifeBar(L_Control.L_LifeBar); } public override void OnShowUi() { _reloadBar.OnShow(); _interactiveTipBar.OnShow(); - _healthBar.OnShow(); _gunBar.OnShow(); + _lifeBar.OnShow(); } public override void OnHideUi() { _reloadBar.OnHide(); _interactiveTipBar.OnHide(); - _healthBar.OnHide(); _gunBar.OnHide(); + _lifeBar.OnHide(); } - public void InitData(Player player) + public void InitData() { - _healthBar.SetMaxHp(player.MaxHp); - _healthBar.SetHp(player.Hp); - _healthBar.SetMaxShield(player.MaxShield); - _healthBar.SetShield(player.Shield); + _lifeBar.RefreshLife(); } public override void Process(float delta) { _gunBar.Process(delta); + _lifeBar.Process(delta); } } \ No newline at end of file