Add door behavior interface and implementations for animation and linear movement
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://b1d2gc8goj6gx"]
|
||||
[gd_scene load_steps=12 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://cratjw4trngpr" path="res://Code/Resources/LerpDoorBehavior.cs" id="2_3dbp0"]
|
||||
[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="Resource" id="Resource_3dbp0"]
|
||||
script = ExtResource("2_3dbp0")
|
||||
_nodeToMovePath = NodePath(".")
|
||||
_openRotationDegrees = Vector3(0, 45, 0)
|
||||
metadata/_custom_type_script = "uid://cratjw4trngpr"
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_u2oqr"]
|
||||
size = Vector3(1, 2, 0.3)
|
||||
|
||||
@@ -14,42 +21,6 @@ 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"
|
||||
@@ -60,11 +31,9 @@ InitialState = 0
|
||||
Requirements = Array[Object]([SubResource("Resource_g2hal")])
|
||||
metadata/_custom_type_script = "uid://ymtyxkea76mv"
|
||||
|
||||
[node name="GreenDoor" type="AnimatableBody3D" node_paths=PackedStringArray("_animationPlayer")]
|
||||
[node name="GreenDoor" type="CharacterBody3D"]
|
||||
script = ExtResource("1_0k8gl")
|
||||
_animationPlayer = NodePath("AnimationPlayer")
|
||||
_openAnimationName = "open"
|
||||
metadata/_custom_type_script = "uid://bxqite0b1di2b"
|
||||
_behavior = SubResource("Resource_3dbp0")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_u2oqr")
|
||||
@@ -73,11 +42,6 @@ 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")])
|
||||
|
||||
Reference in New Issue
Block a user