lever sound

This commit is contained in:
2023-02-08 21:04:23 +01:00
parent 7dd2dab6e3
commit 6a2df611c0
4 changed files with 32 additions and 1 deletions
BIN
View File
Binary file not shown.
+24
View File
@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://dwacmh7cev0de"
path="res://.godot/imported/lever.wav-94d45112f598775e7521fa3501270d7d.sample"
[deps]
source_file="res://Audio/lever.wav"
dest_files=["res://.godot/imported/lever.wav-94d45112f598775e7521fa3501270d7d.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0
+7 -1
View File
@@ -1,8 +1,9 @@
[gd_scene load_steps=7 format=3 uid="uid://b5rve73suh7fc"] [gd_scene load_steps=8 format=3 uid="uid://b5rve73suh7fc"]
[ext_resource type="PackedScene" uid="uid://dnho3rpbb72mw" path="res://Objects/Meshes/lichtkastje.glb" id="1_je302"] [ext_resource type="PackedScene" uid="uid://dnho3rpbb72mw" path="res://Objects/Meshes/lichtkastje.glb" id="1_je302"]
[ext_resource type="Script" path="res://Scripts/lichtkastje.gd" id="2_m7o1t"] [ext_resource type="Script" path="res://Scripts/lichtkastje.gd" id="2_m7o1t"]
[ext_resource type="AudioStream" uid="uid://c6ghhps67gscc" path="res://Audio/lock-open.wav" id="3_ukf3n"] [ext_resource type="AudioStream" uid="uid://c6ghhps67gscc" path="res://Audio/lock-open.wav" id="3_ukf3n"]
[ext_resource type="AudioStream" uid="uid://dwacmh7cev0de" path="res://Audio/lever.wav" id="4_wlnrc"]
[sub_resource type="BoxShape3D" id="BoxShape3D_bfy6m"] [sub_resource type="BoxShape3D" id="BoxShape3D_bfy6m"]
size = Vector3(1, 10, 18) size = Vector3(1, 10, 18)
@@ -38,5 +39,10 @@ collision_layer = 2
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.33084, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.33084, 0)
shape = SubResource("BoxShape3D_uh5nr") shape = SubResource("BoxShape3D_uh5nr")
[node name="LeverOmhaal" type="AudioStreamPlayer3D" parent="Lever" index="1"]
transform = Transform3D(34.7535, 0, 0, 0, 4.8055, 0, 0, 0, 4.8055, 13.254, 0, 0)
stream = ExtResource("4_wlnrc")
unit_size = 1.07
[connection signal="input_event" from="Lock/Lock" to="." method="_on_lock_input_event"] [connection signal="input_event" from="Lock/Lock" to="." method="_on_lock_input_event"]
[connection signal="input_event" from="Lever/Lever" to="." method="_on_lever_input_event"] [connection signal="input_event" from="Lever/Lever" to="." method="_on_lever_input_event"]
+1
View File
@@ -18,6 +18,7 @@ func _on_lock_input_event(_camera, event, _position, _normal, _shape_idx):
func _on_lever_input_event(_camera, event, _position, _normal, _shape_idx): func _on_lever_input_event(_camera, event, _position, _normal, _shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"): if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Lever/LeverOmhaal.playing = true
$Lever.rotation.z = $Lever.rotation.z + PI $Lever.rotation.z = $Lever.rotation.z + PI
indirect_light.visible = !indirect_light.visible indirect_light.visible = !indirect_light.visible
if indirect_light.visible: if indirect_light.visible: