🚧 WIP first setup completed (still buggy!)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://pflu0uaig7vv"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ccc6m6c5khd2x" path="res://scripts/CSharp/Common/CharacterControls/DetectionCross.cs" id="1_va8tx"]
|
||||
[ext_resource type="PackedScene" uid="uid://dugr6ff1g7hi0" path="res://prefabs/interactions/detector.tscn" id="2_8hh05"]
|
||||
|
||||
[node name="DetectionCross" type="Node2D" node_paths=PackedStringArray("_left", "_right", "_up", "_down")]
|
||||
script = ExtResource("1_va8tx")
|
||||
_left = NodePath("detector_left")
|
||||
_right = NodePath("detector_right")
|
||||
_up = NodePath("detector_top")
|
||||
_down = NodePath("detector_bottom")
|
||||
|
||||
[node name="detector_right" parent="." instance=ExtResource("2_8hh05")]
|
||||
position = Vector2(300, 250)
|
||||
|
||||
[node name="detector_left" parent="." instance=ExtResource("2_8hh05")]
|
||||
position = Vector2(-300, 250)
|
||||
|
||||
[node name="detector_top" parent="." instance=ExtResource("2_8hh05")]
|
||||
position = Vector2(0, -200)
|
||||
|
||||
[node name="detector_bottom" parent="." instance=ExtResource("2_8hh05")]
|
||||
position = Vector2(0, 700)
|
||||
@@ -0,0 +1,17 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dugr6ff1g7hi0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3pd60biootsx" path="res://scripts/CSharp/Common/CharacterControls/Detector.cs" id="1_6pib0"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qwv4c"]
|
||||
size = Vector2(300, 300)
|
||||
|
||||
[node name="right" type="Area2D"]
|
||||
collision_layer = 4
|
||||
script = ExtResource("1_6pib0")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_qwv4c")
|
||||
debug_color = Color(0.9459047, 7.2196126e-06, 0.5925879, 0.41960785)
|
||||
|
||||
[connection signal="InteractableEntered" from="." to="CollisionShape2D" method="hide"]
|
||||
[connection signal="InteractableExited" from="." to="CollisionShape2D" method="show"]
|
||||
@@ -1,7 +1,8 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cqc72e4hq6bcd"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cqc72e4hq6bcd"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ckp413wrub5fm" path="res://scripts/CSharp/Common/CharacterControls/InteractionArea2D.cs" id="1_5ajrf"]
|
||||
[ext_resource type="Material" uid="uid://blch5kdhkbj75" path="res://art/materials/simple_interactable_outline.tres" id="2_qoey7"]
|
||||
[ext_resource type="Script" uid="uid://cp2q4k62sjo6h" path="res://scripts/CSharp/Common/CharacterControls/DetectableInteractionArea.cs" id="3_2wrrq"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_npluf"]
|
||||
resource_local_to_scene = true
|
||||
@@ -16,8 +17,10 @@ _area = NodePath("Area2D")
|
||||
_label = NodePath("Area2D/CanvasLayer/MarginContainer/Label")
|
||||
_outlineMaterial = ExtResource("2_qoey7")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
[node name="Area2D" type="Area2D" parent="." node_paths=PackedStringArray("_interactionArea2D")]
|
||||
collision_mask = 4
|
||||
script = ExtResource("3_2wrrq")
|
||||
_interactionArea2D = NodePath("..")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource("CircleShape2D_npluf")
|
||||
@@ -49,5 +52,5 @@ text = "[E]"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 2
|
||||
|
||||
[connection signal="body_entered" from="Area2D" to="." method="OnPlayerEntered"]
|
||||
[connection signal="body_exited" from="Area2D" to="." method="OnPlayerExited"]
|
||||
[connection signal="area_entered" from="Area2D" to="." method="OnPlayerEntered"]
|
||||
[connection signal="area_exited" from="Area2D" to="." method="OnPlayerExited"]
|
||||
|
||||
Reference in New Issue
Block a user