Interactions

This commit is contained in:
Rendo 2025-12-26 01:31:21 +05:00
commit 4f6c151e25
31 changed files with 498 additions and 12 deletions

51
scenes/spoon.tscn Normal file
View file

@ -0,0 +1,51 @@
[gd_scene load_steps=10 format=3 uid="uid://emm545mj0kba"]
[ext_resource type="ArrayMesh" uid="uid://cdvben7q8oxgf" path="res://assets/meshes/spoon.res" id="1_l12hh"]
[ext_resource type="Script" uid="uid://bjnv2g1ni0525" path="res://src/drag/draggable_object.gd" id="1_r8mox"]
[ext_resource type="Texture2D" uid="uid://cw3jw8qbvj3fv" path="res://assets/textures/solid.png" id="3_ckduo"]
[ext_resource type="Script" uid="uid://bl0ojhc0thk1p" path="res://src/interactible/interactible.gd" id="3_r8ydw"]
[ext_resource type="ArrayMesh" uid="uid://n4ibk6y8t7h3" path="res://assets/meshes/spoon_fill.res" id="4_5mau7"]
[ext_resource type="Script" uid="uid://cefmx4p018028" path="res://src/interactible/spoon_interaction.gd" id="4_fyayl"]
[ext_resource type="Script" uid="uid://dig825r70a0sn" path="res://src/substance_display.gd" id="5_33jiv"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1r65c"]
albedo_texture = ExtResource("3_ckduo")
[sub_resource type="BoxShape3D" id="BoxShape3D_r8mox"]
size = Vector3(0.26538086, 0.1484375, 1.6950684)
[node name="Spoon" type="Area3D" node_paths=PackedStringArray("interactible")]
collision_layer = 6
script = ExtResource("1_r8mox")
interactible = NodePath("Interactible")
mask = PackedStringArray("flask", "solid_source")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.07224345, 0)
mesh = ExtResource("1_l12hh")
[node name="SpoonFill" type="MeshInstance3D" parent="."]
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.07224345, -0.66295564)
visible = false
material_override = SubResource("StandardMaterial3D_1r65c")
mesh = ExtResource("4_5mau7")
script = ExtResource("5_33jiv")
display_type = 1
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.07224345, 0)
shape = SubResource("BoxShape3D_r8mox")
[node name="Interactible" type="ConfirmationDialog" parent="."]
title = ""
ok_button_text = "Подтвердить"
cancel_button_text = "Отменить"
script = ExtResource("3_r8ydw")
instant = true
metadata/_custom_type_script = "uid://bl0ojhc0thk1p"
[node name="Interaction" type="Node" parent="Interactible"]
script = ExtResource("4_fyayl")
[connection signal="interacted" from="Interactible" to="Interactible/Interaction" method="_on_interactible_interacted"]
[connection signal="inventory_updated" from="Interactible/Interaction" to="SpoonFill" method="update_material_unfiltered"]