Added visibility component

This commit is contained in:
2024-02-13 20:38:17 +01:00
parent 5caf5f6c71
commit 7937645028
12 changed files with 124 additions and 107 deletions

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=14 format=3 uid="uid://cb2t7bvvf3gwh"]
[gd_scene load_steps=15 format=3 uid="uid://cb2t7bvvf3gwh"]
[ext_resource type="PackedScene" uid="uid://b358op5h1y83m" path="res://assets/slime/Slime.blend" id="1_1h1hj"]
[ext_resource type="Script" path="res://enemy/Enemy.gd" id="1_r5888"]
@ -8,10 +8,10 @@
[ext_resource type="PackedScene" uid="uid://bfvudkup0xsq4" path="res://enemy/death/DeathComponent.tscn" id="6_68kgw"]
[ext_resource type="PackedScene" uid="uid://dl4vcp04t8iyr" path="res://item/soul/Soul.tscn" id="7_i0rtb"]
[ext_resource type="Script" path="res://enemy/EnemyController.gd" id="8_b7r6l"]
[ext_resource type="PackedScene" uid="uid://c8lifxuvpchu3" path="res://player/visibility/VisibilityComponent.tscn" id="9_ssc7p"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_ub3kk"]
height = 0.5
radius = 0.35
[sub_resource type="SphereShape3D" id="SphereShape3D_s5ct7"]
radius = 0.4
[sub_resource type="Animation" id="Animation_vjs0t"]
resource_name = "slime_death"
@ -60,11 +60,12 @@ script = ExtResource("1_r5888")
[node name="Model" parent="." instance=ExtResource("1_1h1hj")]
[node name="Collision" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0452515, 0.3, 0)
shape = SubResource("CylinderShape3D_ub3kk")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.4, 0)
shape = SubResource("SphereShape3D_s5ct7")
[node name="HUD" parent="." node_paths=PackedStringArray("health") instance=ExtResource("3_4jtio")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.986405, 0)
visible = false
health = NodePath("../Health")
[node name="Animation" type="AnimationPlayer" parent="."]
@ -88,3 +89,10 @@ drop = ExtResource("7_i0rtb")
[node name="EnemyController" type="Node" parent="."]
script = ExtResource("8_b7r6l")
[node name="Visibility" parent="." node_paths=PackedStringArray("health", "hud") instance=ExtResource("9_ssc7p")]
health = NodePath("../Health")
hud = NodePath("../HUD")
hud_distance = 50.0
physics_distance = 50.0
render_distance = 100.0