[gd_scene load_steps=25 format=3 uid="uid://dgfh1lgxud87u"]

[ext_resource type="Script" uid="uid://b516jj4kwrvho" path="res://src/world.gd" id="1_2kvs8"]
[ext_resource type="PackedScene" uid="uid://c4orppao35wg6" path="res://prefabs/character.tscn" id="2_v34ds"]
[ext_resource type="Script" uid="uid://b1roviltcxswt" path="res://src/interactable.gd" id="3_mxyfw"]
[ext_resource type="Script" uid="uid://blwx7468vta0e" path="res://src/spawner.gd" id="3_xxi2i"]
[ext_resource type="Material" uid="uid://db6w5h7nkrh" path="res://materials/highlight.tres" id="4_ujno1"]
[ext_resource type="AudioStream" uid="uid://brmgyma8s5cv0" path="res://sounds/quack.mp3" id="5_5p8s7"]
[ext_resource type="Environment" uid="uid://b8fqed8jo6yqj" path="res://scenes/main/main_environment.tres" id="6_p0lc8"]
[ext_resource type="Script" uid="uid://dyohpsoni5hdk" path="res://src/Actions/SceneChangeAction.gd" id="7_dpx6x"]
[ext_resource type="Script" uid="uid://flr0tadklbny" path="res://src/CompositorEffects/new_script.gd" id="9_p3c3q"]

[sub_resource type="BoxShape3D" id="BoxShape3D_vbj2x"]
size = Vector3(200, 1, 200)

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jqeof"]
albedo_color = Color(0.380392, 0.235294, 0.0470588, 1)

[sub_resource type="PlaneMesh" id="PlaneMesh_03bca"]
material = SubResource("StandardMaterial3D_jqeof")
size = Vector2(200, 200)

[sub_resource type="Animation" id="Animation_jap08"]
resource_name = "button"
length = 0.2
tracks/0/type = "position_3d"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0, 0.1, 1, 0, 0, 0.0581902, 0.2, 1, 0, 0, 0)

[sub_resource type="AnimationLibrary" id="AnimationLibrary_hqvaa"]
_data = {
&"button": SubResource("Animation_jap08")
}

[sub_resource type="GDScript" id="GDScript_ieo6a"]
script/source = "extends AudioStreamPlayer3D


func _on_static_body_3d_2_interacted() -> void:
	play()
"

[sub_resource type="BoxShape3D" id="BoxShape3D_p7pa6"]
size = Vector3(0.1, 0.1, 0.1)

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_02n7n"]
albedo_color = Color(1, 0, 0, 1)

[sub_resource type="BoxShape3D" id="BoxShape3D_gru1n"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0fl8j"]
albedo_color = Color(0.027451, 0.0784314, 0.203922, 1)

[sub_resource type="PackedScene" id="PackedScene_acm8y"]
_bundled = {
"conn_count": 0,
"conns": PackedInt32Array(),
"editable_instances": [],
"names": PackedStringArray("Box", "RigidBody3D", "transform", "freeze_mode", "script", "action_label", "can_be_picked_up", "visual_mesh", "highlight_material", "CollisionShape3D", "CollisionShape3D", "shape", "CSGBox3D", "CSGBox3D", "material"),
"node_count": 3,
"node_paths": [NodePath("."), NodePath(".")],
"nodes": PackedInt32Array(-1, -1, 1, 0, -1, 7, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 1073741831, 5, 8, 6, 0, 1073741824, 0, 10, 9, -1, 1, 11, 7, 0, 1073741825, 0, 13, 12, -1, 1, 14, 8, 0),
"variants": [Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.68274, 0.831629, 0), 1, ExtResource("3_mxyfw"), "Pick up hexahedron", true, NodePath("CSGBox3D"), ExtResource("4_ujno1"), SubResource("BoxShape3D_gru1n"), SubResource("StandardMaterial3D_0fl8j")],
"version": 3
}

[sub_resource type="BoxShape3D" id="BoxShape3D_pk5j7"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jl3vg"]
albedo_color = Color(0.027451, 0.0784314, 0.203922, 1)

[sub_resource type="CompositorEffect" id="CompositorEffect_pcdkj"]
resource_local_to_scene = false
resource_name = ""
enabled = true
effect_callback_type = 4
needs_motion_vectors = false
needs_normal_roughness = false
script = ExtResource("9_p3c3q")

[sub_resource type="Compositor" id="Compositor_ip8ui"]
compositor_effects = Array[CompositorEffect]([SubResource("CompositorEffect_pcdkj")])

[node name="Main" type="Node3D"]
script = ExtResource("1_2kvs8")

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.671816, -0.457968, 0.582175, -0.273103, 0.577442, 0.769399, -0.688533, -0.675889, 0.262862, 0, 0, 0)
light_energy = 3.0
shadow_enabled = true
directional_shadow_mode = 1
directional_shadow_split_1 = 0.2
directional_shadow_split_2 = 0.1
directional_shadow_split_3 = 0.3
directional_shadow_fade_start = 1.0
directional_shadow_max_distance = 50.0

[node name="StaticBody3D" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.6174, 0, 0)

[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
shape = SubResource("BoxShape3D_vbj2x")

[node name="CSGMesh3D" type="CSGMesh3D" parent="StaticBody3D"]
mesh = SubResource("PlaneMesh_03bca")

[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
use_collision = true

[node name="Box" type="CSGBox3D" parent="CSGCombiner3D"]

[node name="Box6" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.498871, -3.33969)
size = Vector3(1, 0.253906, 1)

[node name="Box7" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.138916, -3.84261)
size = Vector3(1, 0.253906, 1)

[node name="Box8" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0638185, -4.34447)
size = Vector3(1, 0.253906, 1)

[node name="Box9" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.276995, -4.88516)
size = Vector3(1, 0.253906, 1)

[node name="Box5" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.37539, 1.21157, -5.02753)

[node name="Box2" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.5, 0.5)

[node name="Box4" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.06635, 1.17009, -1.15682)
size = Vector3(1, 1, 4.31364)

[node name="Box3" type="CSGBox3D" parent="CSGCombiner3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.15636, 1.09924, 0.824171)
size = Vector3(3.28895, 0.716575, 1)

[node name="Spawner" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.24057, -4.76837e-07, -2.07045)
script = ExtResource("3_xxi2i")
object_to_spawn = ExtResource("2_v34ds")

[node name="StaticBody3D2" type="StaticBody3D" parent="." node_paths=PackedStringArray("visual_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.45341, 1.66791, 0.279563)
script = ExtResource("3_mxyfw")
action_label = "Quack"
visual_mesh = NodePath("CSGBox3D")
highlight_material = ExtResource("4_ujno1")

[node name="AnimationPlayer" type="AnimationPlayer" parent="StaticBody3D2"]
root_node = NodePath("../CSGBox3D")
libraries = {
&"": SubResource("AnimationLibrary_hqvaa")
}

[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="StaticBody3D2"]
stream = ExtResource("5_5p8s7")
script = SubResource("GDScript_ieo6a")

[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D2"]
shape = SubResource("BoxShape3D_p7pa6")

[node name="CSGBox3D" type="CSGBox3D" parent="StaticBody3D2"]
size = Vector3(0.1, 0.1, 0.1)
material = SubResource("StandardMaterial3D_02n7n")

[node name="StaticBody3D3" type="StaticBody3D" parent="." node_paths=PackedStringArray("visual_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.78427, 1.66791, 0.279563)
script = ExtResource("3_mxyfw")
action_label = "Spawn Hexahedron"
visual_mesh = NodePath("CSGBox3D")
highlight_material = ExtResource("4_ujno1")

[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D3"]
shape = SubResource("BoxShape3D_p7pa6")

[node name="CSGBox3D" type="CSGBox3D" parent="StaticBody3D3"]
size = Vector3(0.1, 0.1, 0.1)
material = SubResource("StandardMaterial3D_02n7n")

[node name="Spawner" type="Node3D" parent="StaticBody3D3"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.547359, 0.647922)
script = ExtResource("3_xxi2i")
object_to_spawn = SubResource("PackedScene_acm8y")
auto_spawn = false

[node name="StaticBody3D4" type="StaticBody3D" parent="." node_paths=PackedStringArray("visual_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.15809, 1.66791, 0.279563)
script = ExtResource("3_mxyfw")
action_label = "Move to next world"
visual_mesh = NodePath("CSGBox3D")
highlight_material = ExtResource("4_ujno1")

[node name="SceneChangeAction" type="Node" parent="StaticBody3D4"]
script = ExtResource("7_dpx6x")

[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D4"]
shape = SubResource("BoxShape3D_p7pa6")

[node name="CSGBox3D" type="CSGBox3D" parent="StaticBody3D4"]
size = Vector3(0.1, 0.1, 0.1)
material = SubResource("StandardMaterial3D_02n7n")

[node name="Box" type="RigidBody3D" parent="." node_paths=PackedStringArray("visual_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.68274, 0.831629, 0)
freeze_mode = 1
script = ExtResource("3_mxyfw")
action_label = "Pick up hexahedron"
can_be_picked_up = true
visual_mesh = NodePath("CSGBox3D")
highlight_material = ExtResource("4_ujno1")

[node name="CollisionShape3D" type="CollisionShape3D" parent="Box"]
shape = SubResource("BoxShape3D_pk5j7")

[node name="CSGBox3D" type="CSGBox3D" parent="Box"]
material = SubResource("StandardMaterial3D_jl3vg")

[node name="CSGBox3D" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.35573, 0)
material = ExtResource("4_ujno1")

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = ExtResource("6_p0lc8")
compositor = SubResource("Compositor_ip8ui")

[node name="LightmapGI" type="LightmapGI" parent="."]

[connection signal="interacted" from="StaticBody3D2" to="StaticBody3D2/AudioStreamPlayer3D" method="_on_static_body_3d_2_interacted"]
[connection signal="interacted" from="StaticBody3D2" to="StaticBody3D2/AnimationPlayer" method="play" binds= ["button"]]
[connection signal="interacted" from="StaticBody3D3" to="StaticBody3D3/Spawner" method="spawn"]
[connection signal="interacted" from="StaticBody3D4" to="StaticBody3D4/SceneChangeAction" method="perform_action"]
