Add door interaction system with requirements and HUD integration

This commit is contained in:
2025-10-30 00:57:28 +01:00
parent 9c0cd3f549
commit 5ae8b6f08c
21 changed files with 337 additions and 14 deletions

84
Objects/green_door.tscn Normal file
View File

@@ -0,0 +1,84 @@
[gd_scene load_steps=13 format=3 uid="uid://b1d2gc8goj6gx"]
[ext_resource type="Script" uid="uid://bxqite0b1di2b" path="res://Code/Presenters/DoorPresenter.cs" id="1_0k8gl"]
[ext_resource type="Script" uid="uid://b6x8llipvutqs" path="res://Code/Presenters/SceneEntity.cs" id="2_l5dry"]
[ext_resource type="Script" uid="uid://dnyfoaprv6bhw" path="res://Code/Resources/RequiresItemRequirementResource.cs" id="3_3dbp0"]
[ext_resource type="Script" uid="uid://ymtyxkea76mv" path="res://Code/Resources/DoorComponentResource.cs" id="4_g4ryb"]
[sub_resource type="BoxMesh" id="BoxMesh_u2oqr"]
size = Vector3(1, 2, 0.3)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_l4yuh"]
albedo_color = Color(0.14891627, 0.744422, 0, 1)
[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_l5dry"]
points = PackedVector3Array(-0.5, -1, -0.15, -0.5, -1, 0.15, -0.5, 1, -0.15, 0.5, -1, -0.15, 0.5, -1, 0.15, -0.5, 1, 0.15, 0.5, 1, -0.15, 0.5, 1, 0.15)
[sub_resource type="Animation" id="Animation_rv1pd"]
resource_name = "open"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(0, 3, 0)]
}
[sub_resource type="Animation" id="Animation_me0pg"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dgrt5"]
_data = {
&"RESET": SubResource("Animation_me0pg"),
&"open": SubResource("Animation_rv1pd")
}
[sub_resource type="Resource" id="Resource_g2hal"]
script = ExtResource("3_3dbp0")
metadata/_custom_type_script = "uid://dnyfoaprv6bhw"
[sub_resource type="Resource" id="Resource_fyehb"]
script = ExtResource("4_g4ryb")
InitialState = 0
Requirements = Array[Object]([SubResource("Resource_g2hal")])
metadata/_custom_type_script = "uid://ymtyxkea76mv"
[node name="GreenDoor" type="AnimatableBody3D" node_paths=PackedStringArray("_animationPlayer")]
script = ExtResource("1_0k8gl")
_animationPlayer = NodePath("AnimationPlayer")
_openAnimationName = "open"
metadata/_custom_type_script = "uid://bxqite0b1di2b"
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("BoxMesh_u2oqr")
surface_material_override/0 = SubResource("StandardMaterial3D_l4yuh")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("ConvexPolygonShape3D_l5dry")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_dgrt5")
}
[node name="SceneEntity" type="Node" parent="." groups=["SceneEntities"]]
script = ExtResource("2_l5dry")
ComponentResources = Array[Resource]([SubResource("Resource_fyehb")])
metadata/_custom_type_script = "uid://b6x8llipvutqs"