interaction base

This commit is contained in:
Rendo 2025-11-14 12:52:41 +05:00
commit 2f559639fb
21 changed files with 134 additions and 49 deletions

View file

@ -1,44 +1,77 @@
[gd_scene load_steps=7 format=3 uid="uid://bjxjcx2qu16q5"]
[gd_scene load_steps=9 format=3 uid="uid://bjxjcx2qu16q5"]
[ext_resource type="Script" uid="uid://bjnv2g1ni0525" path="res://src/drag/draggable_object.gd" id="1_vcwhe"]
[ext_resource type="Script" uid="uid://ctu7escah5lo1" path="res://src/interactible/interaction_source.gd" id="2_627mb"]
[ext_resource type="PackedScene" uid="uid://b6ydpkle2ol20" path="res://assets/models/FlaskNew.glb" id="2_qf1og"]
[ext_resource type="Script" uid="uid://e8xu57ewvb5a" path="res://src/interactible/proximity_rotator.gd" id="3_00eeh"]
[sub_resource type="SphereShape3D" id="SphereShape3D_vcwhe"]
radius = 0.49570328
[ext_resource type="Script" uid="uid://b1gv6dt8bwj2p" path="res://src/interactible/returner.gd" id="5_bqclg"]
[ext_resource type="Script" uid="uid://dteb2xxl8gixp" path="res://src/ui/slider_display.gd" id="5_qb0nw"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_vcwhe"]
radius = 0.1
height = 0.7
height = 0.9921875
[sub_resource type="CylinderMesh" id="CylinderMesh_627mb"]
top_radius = 0.1
bottom_radius = 0.08
height = 0.5
[sub_resource type="SphereShape3D" id="SphereShape3D_vcwhe"]
radius = 0.49649125
[node name="DraggableObject" type="Area3D"]
script = ExtResource("1_vcwhe")
[node name="DragShape" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_vcwhe")
[node name="DragArea" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_vcwhe")
[node name="InteractionArea" type="Area3D" parent="."]
[node name="FlaskNew" parent="." instance=ExtResource("2_qf1og")]
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, -0.38859487, 0)
[node name="InteractionArea" type="Area3D" parent="." node_paths=PackedStringArray("interaction_dialog")]
collision_layer = 2
collision_mask = 2
input_ray_pickable = false
script = ExtResource("2_627mb")
interaction_dialog = NodePath("../InteractionDialog")
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractionArea"]
shape = SubResource("CapsuleShape3D_vcwhe")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("CylinderMesh_627mb")
[node name="InteractionArea" type="CollisionShape3D" parent="InteractionArea"]
shape = SubResource("SphereShape3D_vcwhe")
[node name="ProximityRotator" type="Node" parent="." node_paths=PackedStringArray("rotated")]
script = ExtResource("3_00eeh")
rotated = NodePath("../MeshInstance3D")
proximity_radius = 0.496
rotated = NodePath("..")
proximity_radius = 0.746
[node name="Returner" type="Node" parent="." node_paths=PackedStringArray("node")]
script = ExtResource("5_bqclg")
node = NodePath("..")
[node name="InteractionDialog" type="ConfirmationDialog" parent="."]
oversampling_override = 1.0
position = Vector2i(0, 36)
size = Vector2i(200, 131)
borderless = true
[node name="VBoxContainer" type="VBoxContainer" parent="InteractionDialog"]
offset_left = 8.0
offset_top = 8.0
offset_right = 192.0
offset_bottom = 82.0
[node name="Label" type="Label" parent="InteractionDialog/VBoxContainer"]
layout_mode = 2
text = "Введите объём"
[node name="HBoxContainer" type="HBoxContainer" parent="InteractionDialog/VBoxContainer"]
layout_mode = 2
[node name="AmountLabel" type="Label" parent="InteractionDialog/VBoxContainer/HBoxContainer" node_paths=PackedStringArray("slider")]
layout_mode = 2
script = ExtResource("5_qb0nw")
slider = NodePath("../HSlider")
suffix = "%"
[node name="HSlider" type="HSlider" parent="InteractionDialog/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[connection signal="drag_ended" from="." to="InteractionArea" method="request_interaction"]
[connection signal="interaction_closed" from="InteractionArea" to="Returner" method="return_to_start"]
[connection signal="interaction_reciever_entered" from="InteractionArea" to="ProximityRotator" method="_on_interaction_area_interaction_reciever_entered"]
[connection signal="interaction_reciever_exited" from="InteractionArea" to="ProximityRotator" method="_on_interaction_area_interaction_reciever_exited"]

View file

@ -1,12 +1,16 @@
[gd_scene load_steps=4 format=3 uid="uid://q1y0r2rn0qb4"]
[gd_scene load_steps=5 format=3 uid="uid://q1y0r2rn0qb4"]
[ext_resource type="Script" uid="uid://mjx50qh1bwv3" path="res://src/interactible/interaction_reciever.gd" id="1_auicg"]
[ext_resource type="Material" uid="uid://64m17act0kwu" path="res://assets/materials/mat_glass.tres" id="2_mqqtq"]
[sub_resource type="CylinderMesh" id="CylinderMesh_nql6a"]
material = ExtResource("2_mqqtq")
height = 0.75
rings = 0
cap_top = false
[sub_resource type="CylinderShape3D" id="CylinderShape3D_auicg"]
height = 1.0
height = 0.7128906
radius = 0.75
[node name="InteractibleObject" type="Area3D"]
@ -19,5 +23,5 @@ script = ExtResource("1_auicg")
mesh = SubResource("CylinderMesh_nql6a")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5867026, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.7302573, 0)
shape = SubResource("CylinderShape3D_auicg")

View file

@ -18,15 +18,16 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.236948, 0.9448395, 1.82942
script = ExtResource("1_hem3r")
[node name="DraggableObject" parent="." instance=ExtResource("1_bb6uc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.236948, 0.9448395, 0.0039073825)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.7153518, 0.9448395, 0.0039073825)
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.8403207, 0.5420896, 0, -0.5420896, 0.8403207, 0, 1.9293891, 0)
shadow_enabled = true
[node name="InteractibleObject" parent="." instance=ExtResource("4_f680m")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.11957906, 0.87858754, -0.0035084486)
[node name="UI" type="CanvasLayer" parent="."]
layer = 100
[node name="UserInterface" parent="UI" instance=ExtResource("3_hflkp")]
[node name="InteractibleObject" parent="." instance=ExtResource("4_f680m")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.11957906, 0.7987209, 0.07669878)