Sign test
This commit is contained in:
44
scenes/Entities/Sign.tscn
Normal file
44
scenes/Entities/Sign.tscn
Normal file
@@ -0,0 +1,44 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://bkj630bhmnvsi"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bitykguiignfu" path="res://scripts/Entity/Sign.gd" id="1_cpa1u"]
|
||||
[ext_resource type="Script" uid="uid://dtjjqp2atjyhr" path="res://scripts/Entity/Entity.gd" id="2_obj4d"]
|
||||
[ext_resource type="Script" uid="uid://03dqknw7v4mr" path="res://scripts/Entity/Component/EntityInteractable.gd" id="3_cpa1u"]
|
||||
[ext_resource type="Shader" uid="uid://7h2axb2tsh17" path="res://shaders/NPC Shader.gdshader" id="7_vqvna"]
|
||||
[ext_resource type="Texture2D" uid="uid://cofrgefp8e617" path="res://textures/human.png" id="8_on2eh"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_cpa1u"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_dyaax"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fegux"]
|
||||
render_priority = 0
|
||||
shader = ExtResource("7_vqvna")
|
||||
shader_parameter/npcTexture = ExtResource("8_on2eh")
|
||||
shader_parameter/color = Color(1, 1, 0, 1)
|
||||
shader_parameter/frame = 0
|
||||
shader_parameter/direction = 2
|
||||
|
||||
[node name="Sign" type="StaticBody3D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 258
|
||||
script = ExtResource("1_cpa1u")
|
||||
metadata/_custom_type_script = "uid://bitykguiignfu"
|
||||
|
||||
[node name="Entity" type="Node" parent="."]
|
||||
script = ExtResource("2_obj4d")
|
||||
metadata/_custom_type_script = "uid://dtjjqp2atjyhr"
|
||||
|
||||
[node name="EntityInteractable" type="Node" parent="Entity" node_paths=PackedStringArray("entityDirection", "entity", "characterBody")]
|
||||
script = ExtResource("3_cpa1u")
|
||||
entityDirection = NodePath("")
|
||||
entity = NodePath("..")
|
||||
characterBody = NodePath("")
|
||||
metadata/_custom_type_script = "uid://03dqknw7v4mr"
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("BoxShape3D_cpa1u")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.173648, 0.984808, 0, -0.984808, 0.173648, 0, 0, 0)
|
||||
mesh = SubResource("QuadMesh_dyaax")
|
||||
surface_material_override/0 = SubResource("ShaderMaterial_fegux")
|
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://dx6fv8n4jl5ku"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://dx6fv8n4jl5ku"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://yhtpoum3eek7" path="res://scenes/Entities/Rosa.tscn" id="1_7b7hx"]
|
||||
[ext_resource type="Script" uid="uid://c37crdel0m5mw" path="res://scripts/Map/Map.gd" id="1_ru75d"]
|
||||
@@ -8,6 +8,7 @@
|
||||
[ext_resource type="Script" uid="uid://tkfc88q8m86f" path="res://scripts/Event/EventConversation.gd" id="5_cg1ph"]
|
||||
[ext_resource type="Script" uid="uid://y7ckj1tn5cro" path="res://scripts/Event/EventTextbox.gd" id="6_gxq5o"]
|
||||
[ext_resource type="Script" uid="uid://c4d7nithqnx5y" path="res://scripts/Event/Quest/EventStartQuest.gd" id="7_brp0k"]
|
||||
[ext_resource type="PackedScene" uid="uid://bkj630bhmnvsi" path="res://scenes/Entities/Sign.tscn" id="9_xfqoe"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_e1h75"]
|
||||
sky_horizon_color = Color(0.59625, 0.6135, 0.6375, 1)
|
||||
@@ -36,6 +37,10 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.19857, 0.684572, 0.968477)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.68747, 0.459578, -0.399262)
|
||||
interactEvent = NodePath("../Events/TestConversation")
|
||||
|
||||
[node name="Sign" parent="." node_paths=PackedStringArray("interactEvent") instance=ExtResource("9_xfqoe")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.36525, 0.136824, 2.58137)
|
||||
interactEvent = NodePath("../Events/TestConversation")
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 7.20244, 3.80554)
|
||||
light_energy = 3.375
|
||||
|
22
scripts/Entity/Sign.gd
Normal file
22
scripts/Entity/Sign.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
class_name Sign extends StaticBody3D
|
||||
|
||||
@export var interactEvent:Event = null
|
||||
|
||||
func _ready() -> void:
|
||||
$Entity/EntityInteractable.onInteract.connect(
|
||||
self.onEntityInteract
|
||||
)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
$Entity/EntityInteractable.onInteract.disconnect(
|
||||
self.onEntityInteract
|
||||
)
|
||||
|
||||
func onEntityInteract(
|
||||
interactor:EntityInteractor,
|
||||
interactee:EntityInteractable
|
||||
) -> void:
|
||||
if interactEvent == null || (interactEvent.started && !interactEvent.isDone()):
|
||||
return
|
||||
|
||||
interactEvent.onEntityInteract(interactor, $Entity/EntityInteractable)
|
1
scripts/Entity/Sign.gd.uid
Normal file
1
scripts/Entity/Sign.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bitykguiignfu
|
Reference in New Issue
Block a user