drag rework
This commit is contained in:
parent
a425f62267
commit
3d81c4af5f
18 changed files with 47 additions and 267 deletions
|
|
@ -1,98 +1,25 @@
|
|||
[gd_scene load_steps=12 format=3 uid="uid://bjxjcx2qu16q5"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://bjxjcx2qu16q5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bjnv2g1ni0525" path="res://src/drag/draggable_object.gd" id="1_0xufn"]
|
||||
[ext_resource type="PackedScene" uid="uid://b6ydpkle2ol20" path="res://assets/models/FlaskNew.glb" id="2_h7awq"]
|
||||
[ext_resource type="Script" uid="uid://mjx50qh1bwv3" path="res://src/interactible/interaction_reciever.gd" id="3_ailwx"]
|
||||
[ext_resource type="Script" uid="uid://ctu7escah5lo1" path="res://src/interactible/interaction_source.gd" id="4_kkw7a"]
|
||||
[ext_resource type="Script" uid="uid://e8xu57ewvb5a" path="res://src/interactible/proximity_rotator.gd" id="5_rqua0"]
|
||||
[ext_resource type="Script" uid="uid://dteb2xxl8gixp" path="res://src/ui/slider_display.gd" id="6_wadb5"]
|
||||
[ext_resource type="Script" uid="uid://82ettbegollp" path="res://src/inventory.gd" id="7_h7awq"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_vcwhe"]
|
||||
radius = 0.1
|
||||
height = 0.9921875
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_0xufn"]
|
||||
height = 0.16210938
|
||||
radius = 0.625
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_vcwhe"]
|
||||
radius = 0.49649125
|
||||
|
||||
[sub_resource type="Curve" id="Curve_qb0nw"]
|
||||
_data = [Vector2(0, 0), 0.0, 0.067761436, 0, 0, Vector2(0.75, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[node name="Flask" type="Area3D"]
|
||||
script = ExtResource("1_0xufn")
|
||||
|
||||
[node name="DragArea" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
shape = SubResource("CapsuleShape3D_vcwhe")
|
||||
|
||||
[node name="FlaskNew" parent="." instance=ExtResource("2_h7awq")]
|
||||
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, -0.38859487, 0)
|
||||
|
||||
[node name="InteractibleArea" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6011598, 0)
|
||||
collision_layer = 6
|
||||
collision_mask = 0
|
||||
script = ExtResource("3_ailwx")
|
||||
metadata/_custom_type_script = "uid://mjx50qh1bwv3"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractibleArea"]
|
||||
shape = SubResource("CylinderShape3D_0xufn")
|
||||
|
||||
[node name="InteractionArea" type="Area3D" parent="." node_paths=PackedStringArray("interaction_dialog")]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
input_ray_pickable = false
|
||||
script = ExtResource("4_kkw7a")
|
||||
interaction_dialog = NodePath("../InteractionDialog")
|
||||
|
||||
[node name="InteractionArea" type="CollisionShape3D" parent="InteractionArea"]
|
||||
shape = SubResource("SphereShape3D_vcwhe")
|
||||
|
||||
[node name="ProximityRotator" type="Node" parent="." node_paths=PackedStringArray("rotated")]
|
||||
script = ExtResource("5_rqua0")
|
||||
rotated = NodePath("..")
|
||||
proximity_radius = 0.1
|
||||
modification_curve = SubResource("Curve_qb0nw")
|
||||
|
||||
[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("6_wadb5")
|
||||
slider = NodePath("../HSlider")
|
||||
suffix = "%"
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="InteractionDialog/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.1, 0)
|
||||
|
||||
[node name="Inventory" type="Node" parent="."]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("7_h7awq")
|
||||
open_on_top = true
|
||||
metadata/_custom_type_script = "uid://82ettbegollp"
|
||||
|
||||
[connection signal="drag_ended" from="." to="InteractionArea" method="request_interaction"]
|
||||
[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"]
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://c7r4rhgj3ucao"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://c7r4rhgj3ucao"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bjxjcx2qu16q5" path="res://scenes/flask.tscn" id="1_bb6uc"]
|
||||
[ext_resource type="Script" uid="uid://crjao0jjv5yqs" path="res://src/drag/draggable_camera.gd" id="1_hem3r"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfxlr4svnsdyx" path="res://scenes/ui.tscn" id="3_hflkp"]
|
||||
[ext_resource type="PackedScene" uid="uid://bx5wihgk668w1" path="res://assets/models/Chemistry.glb" id="5_q4uld"]
|
||||
[ext_resource type="PackedScene" uid="uid://bg8y4u2a4hx3p" path="res://assets/models/Drip.glb" id="6_gipex"]
|
||||
[ext_resource type="PackedScene" uid="uid://dwtaqdacgcysa" path="res://assets/models/FlaskHolder.glb" id="7_064jp"]
|
||||
[ext_resource type="Environment" uid="uid://clgblxkcf822n" path="res://assets/Environment.tres" id="8_4kvtl"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_cbcd7"]
|
||||
size = Vector3(3.535, 1, 1)
|
||||
size = Vector3(4, 1, 2)
|
||||
|
||||
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_hflkp"]
|
||||
|
||||
[node name="Lab" type="Node3D"]
|
||||
|
||||
|
|
@ -18,11 +16,11 @@ transform = Transform3D(2.4088485, 0, 0, 0, 1, 0, 0, 0, 2.8214846, 0, 0, 0)
|
|||
mesh = SubResource("BoxMesh_cbcd7")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.236948, 0.9448395, 1.8294222)
|
||||
transform = Transform3D(1, 0, 0, 0, 0.86602545, 0.5, 0, -0.5, 0.8660253, -1.236948, 2.5364435, 3.1829531)
|
||||
script = ExtResource("1_hem3r")
|
||||
|
||||
[node name="Flask" parent="." instance=ExtResource("1_bb6uc")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.6518283, 1.0920403, 0.0039073825)
|
||||
[node name="DragRaycast" type="RayCast3D" parent="Camera3D"]
|
||||
target_position = Vector3(0, 0, -10)
|
||||
|
||||
[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)
|
||||
|
|
@ -33,14 +31,11 @@ layer = 100
|
|||
|
||||
[node name="UserInterface" parent="UI" instance=ExtResource("3_hflkp")]
|
||||
|
||||
[node name="Chemistry" parent="." instance=ExtResource("5_q4uld")]
|
||||
transform = Transform3D(-1.0927847e-08, 0, -0.25, 0, 0.25, 0, 0.25, 0, -1.0927847e-08, -3.030859, 0.55043614, -0.9607215)
|
||||
|
||||
[node name="Drip2" parent="." instance=ExtResource("6_gipex")]
|
||||
transform = Transform3D(0.25, 0, 0, 0, 0.25, 0, 0, 0, 0.25, 1.3666252, 0.06701976, 0.014619827)
|
||||
|
||||
[node name="FlaskHolder2" parent="." instance=ExtResource("7_064jp")]
|
||||
transform = Transform3D(0.09002048, 0, -0.04354668, 0, 0.1, 0, 0.04354668, 0, 0.09002048, -3.3602376, 1.0968089, 0.2888375)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = ExtResource("8_4kvtl")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="."]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
shape = SubResource("WorldBoundaryShape3D_hflkp")
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
[gd_scene load_steps=12 format=3 uid="uid://cw6v8kbi76qak"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cw6v8kbi76qak"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bjnv2g1ni0525" path="res://src/drag/draggable_object.gd" id="1_o7vug"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://dddqboph2ygmw" path="res://assets/meshes/jar.res" id="2_o7vug"]
|
||||
[ext_resource type="Script" uid="uid://ctu7escah5lo1" path="res://src/interactible/interaction_source.gd" id="3_00jpx"]
|
||||
[ext_resource type="Script" uid="uid://e8xu57ewvb5a" path="res://src/interactible/proximity_rotator.gd" id="4_ymvgp"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://dxeseuqcwne1m" path="res://assets/meshes/jar_fill.res" id="6_kfk5m"]
|
||||
[ext_resource type="Script" uid="uid://co33kqhl3n06u" path="res://src/interactible/destructor.gd" id="7_00jpx"]
|
||||
[ext_resource type="Script" uid="uid://c8epd7gguvyop" path="res://src/substance_holder.gd" id="7_ymvgp"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pcpcb"]
|
||||
|
|
@ -15,79 +12,21 @@ resource_local_to_scene = true
|
|||
height = 0.5024414
|
||||
radius = 0.22460938
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_vcwhe"]
|
||||
radius = 0.49649125
|
||||
|
||||
[sub_resource type="Curve" id="Curve_qb0nw"]
|
||||
_data = [Vector2(0, 0), 0.0, 0.067761436, 0, 0, Vector2(0.75, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[node name="Flask" type="Area3D"]
|
||||
script = ExtResource("1_o7vug")
|
||||
|
||||
[node name="Jar" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, -0.20877336, 0)
|
||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0)
|
||||
mesh = ExtResource("2_o7vug")
|
||||
|
||||
[node name="JarFill" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, -0.20759426, 0)
|
||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0)
|
||||
material_override = SubResource("StandardMaterial3D_pcpcb")
|
||||
mesh = ExtResource("6_kfk5m")
|
||||
|
||||
[node name="DragArea" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.04284668, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.25, 0)
|
||||
shape = SubResource("CylinderShape3D_kfk5m")
|
||||
|
||||
[node name="InteractionArea" type="Area3D" parent="." node_paths=PackedStringArray("interaction_dialog")]
|
||||
collision_layer = 4
|
||||
collision_mask = 4
|
||||
input_ray_pickable = false
|
||||
script = ExtResource("3_00jpx")
|
||||
interaction_dialog = NodePath("../InteractionDialog")
|
||||
|
||||
[node name="InteractionArea" type="CollisionShape3D" parent="InteractionArea"]
|
||||
shape = SubResource("SphereShape3D_vcwhe")
|
||||
|
||||
[node name="ProximityRotator" type="Node" parent="." node_paths=PackedStringArray("rotated")]
|
||||
script = ExtResource("4_ymvgp")
|
||||
rotated = NodePath("..")
|
||||
proximity_radius = 0.1
|
||||
modification_curve = SubResource("Curve_qb0nw")
|
||||
|
||||
[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="SpinBox" type="SpinBox" parent="InteractionDialog/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
max_value = 10.0
|
||||
step = 0.01
|
||||
allow_greater = true
|
||||
suffix = "мг"
|
||||
|
||||
[node name="DestructorOnStop" type="Node" parent="." node_paths=PackedStringArray("node")]
|
||||
script = ExtResource("7_00jpx")
|
||||
node = NodePath("..")
|
||||
|
||||
[node name="SubstanceData" type="Node" parent="."]
|
||||
script = ExtResource("7_ymvgp")
|
||||
|
||||
[connection signal="drag_ended" from="." to="InteractionArea" method="request_interaction"]
|
||||
[connection signal="interaction_closed" from="InteractionArea" to="DestructorOnStop" method="destruct"]
|
||||
[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"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue