Button sound fix

This commit is contained in:
Thomas Muller 2023-10-02 00:40:13 -04:00
parent 6283e41488
commit c9ae7e7263
2 changed files with 7 additions and 5 deletions

View file

@ -60,14 +60,14 @@ func interact(other):
func _on_anim_finished(name): func _on_anim_finished(name):
if _resetting: if _resetting:
_sound.stop()
_sound.stream = release_sound
_sound.play()
_button.material = released_material _button.material = released_material
_resetting = false _resetting = false
_triggered = false _triggered = false
if momentary and _triggered: if momentary and _triggered:
_sound.stop()
_sound.stream = release_sound
_sound.play()
_anim.play_backwards('trigger') _anim.play_backwards('trigger')
_resetting = true _resetting = true

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://bp1fooevcl4lk"] [gd_scene load_steps=13 format=3 uid="uid://bp1fooevcl4lk"]
[ext_resource type="ArrayMesh" uid="uid://cfm21e1rmsbvt" path="res://assets/maps/devworld.obj" id="1_67d5q"] [ext_resource type="ArrayMesh" uid="uid://cfm21e1rmsbvt" path="res://assets/maps/devworld.obj" id="1_67d5q"]
[ext_resource type="PackedScene" uid="uid://wl1n3y8mcq0x" path="res://Commentary.tscn" id="2_3gk04"] [ext_resource type="PackedScene" uid="uid://wl1n3y8mcq0x" path="res://Commentary.tscn" id="2_3gk04"]
@ -8,6 +8,7 @@
[ext_resource type="PackedScene" uid="uid://cp4rwojl3c3y3" path="res://test.tscn" id="6_8wwor"] [ext_resource type="PackedScene" uid="uid://cp4rwojl3c3y3" path="res://test.tscn" id="6_8wwor"]
[ext_resource type="AudioStream" uid="uid://kbklqaa8yx0s" path="res://assets/sounds/button/buttonin01.ogg" id="6_dw4i0"] [ext_resource type="AudioStream" uid="uid://kbklqaa8yx0s" path="res://assets/sounds/button/buttonin01.ogg" id="6_dw4i0"]
[ext_resource type="PackedScene" uid="uid://cjn7bvtws2uip" path="res://Door.tscn" id="7_0wker"] [ext_resource type="PackedScene" uid="uid://cjn7bvtws2uip" path="res://Door.tscn" id="7_0wker"]
[ext_resource type="AudioStream" uid="uid://c5l601q6jd63f" path="res://assets/sounds/button/buttonout01.ogg" id="7_qprql"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_fwixm"] [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_fwixm"]
data = PackedVector3Array(-504, -64, 256, -504, -64, 128, -504, -192, 128, -504, -192, 256, -504, -64, 256, -504, -192, 128, -504, -64, 256, -512, -64, 256, -512, -64, 128, -504, -64, 128, -504, -64, 256, -512, -64, 128, -504, -64, 256, -504, -192, 256, -512, -192, 256, -512, -64, 256, -504, -64, 256, -512, -192, 256, -504, -64, 128, -512, -64, 128, -512, -192, 128, -504, -192, 128, -504, -64, 128, -512, -192, 128, -504, -192, 256, -504, -192, 128, -512, -192, 128, -512, -192, 256, -504, -192, 256, -512, -192, 128, -512, -64, 256, -512, -192, 256, -512, -192, 128, -512, -64, 128, -512, -64, 256, -512, -192, 128, -128, 64, 8, -128, 64, 0, -128, -320, 0, -128, -320, 8, -128, 64, 8, -128, -320, 0, -128, 64, 8, -512, 64, 8, -512, 64, 0, -128, 64, 0, -128, 64, 8, -512, 64, 0, -128, 64, 8, -128, -320, 8, -512, -320, 8, -512, 64, 8, -128, 64, 8, -512, -320, 8, -128, 64, 0, -512, 64, 0, -512, -320, 0, -128, -320, 0, -128, 64, 0, -512, -320, 0, -128, -320, 8, -128, -320, 0, -512, -320, 0, -512, -320, 8, -128, -320, 8, -512, -320, 0, -512, 64, 8, -512, -320, 8, -512, -320, 0, -512, 64, 0, -512, 64, 8, -512, -320, 0, -512, 64, 392, -512, 64, 8, -512, -320, 8, -512, -320, 392, -512, 64, 392, -512, -320, 8, -512, 64, 392, -520, 64, 392, -520, 64, 8, -512, 64, 8, -512, 64, 392, -520, 64, 8, -512, 64, 392, -512, -320, 392, -520, -320, 392, -520, 64, 392, -512, 64, 392, -520, -320, 392, -512, 64, 8, -520, 64, 8, -520, -320, 8, -512, -320, 8, -512, 64, 8, -520, -320, 8, -520, 64, 392, -520, -320, 392, -520, -320, 8, -520, 64, 8, -520, 64, 392, -520, -320, 8, -512, -320, 392, -512, -320, 8, -520, -320, 8, -520, -320, 392, -512, -320, 392, -520, -320, 8, 512, 1024, 416, 512, 1024, 96, 512, 1016, 96, 512, 1016, 416, 512, 1024, 416, 512, 1016, 96, 512, 1016, 96, 512, 1024, 96, 512, 1016, 0, 512, 1024, 96, 512, 1024, 0, 512, 1016, 0, -512, 1024, 96, 512, 1024, 96, 512, 1024, 416, 512, 1024, 96, 16, 1024, 96, 16, 1024, 0, 512, 1024, 96, 16, 1024, 0, 512, 1024, 0, -512, 1024, 96, 512, 1024, 416, -512, 1024, 416, -32, 1024, 96, -512, 1024, 96, -512, 1024, 0, -32, 1024, 96, -512, 1024, 0, -32, 1024, 0, 512, 1024, 96, 512, 1016, 96, 16, 1016, 96, 16, 1024, 96, 512, 1024, 96, 16, 1016, 96, 512, 1024, 0, 16, 1024, 0, 16, 1016, 0, 512, 1016, 0, 512, 1024, 0, 16, 1016, 0, 512, 1016, 416, 512, 1016, 96, -512, 1016, 96, 512, 1016, 96, 512, 1016, 0, 16, 1016, 0, 512, 1016, 96, 16, 1016, 0, 16, 1016, 96, 512, 1016, 416, -512, 1016, 96, -512, 1016, 416, -512, 1016, 0, -512, 1016, 96, -32, 1016, 96, -512, 1016, 0, -32, 1016, 96, -32, 1016, 0, 16, 1024, 96, 16, 1016, 96, 16, 1016, 0, 16, 1024, 0, 16, 1024, 96, 16, 1016, 0, -32, 1024, 96, -32, 1024, 0, -32, 1016, 0, -32, 1016, 96, -32, 1024, 96, -32, 1016, 0, 512, 1024, 416, 512, 1016, 416, -512, 1016, 416, -512, 1024, 416, 512, 1024, 416, -512, 1016, 416, -32, 1024, 96, -32, 1016, 96, -512, 1016, 96, -512, 1024, 96, -32, 1024, 96, -512, 1016, 96, 512, 1024, 96, -512, 1024, 96, -512, 1016, 96, 512, 1016, 96, 512, 1024, 96, -512, 1016, 96, -512, 1024, 416, -512, 1016, 416, -512, 1016, 96, -512, 1024, 96, -512, 1024, 416, -512, 1016, 96, -512, 1024, 96, -512, 1016, 96, -512, 1016, 0, -512, 1024, 0, -512, 1024, 96, -512, 1016, 0, -32, 1024, 0, -512, 1024, 0, -512, 1016, 0, -32, 1016, 0, -32, 1024, 0, -512, 1016, 0, 1024, 1024, 0, 1024, 1024, -64, 1024, -1024, -64, 1024, -1024, 0, 1024, 1024, 0, 1024, -1024, -64, 1024, 1024, 0, -1024, 1024, 0, -1024, 1024, -64, 1024, 1024, -64, 1024, 1024, 0, -1024, 1024, -64, 1024, 1024, 0, 1024, -1024, 0, -1024, -1024, 0, -1024, 1024, 0, 1024, 1024, 0, -1024, -1024, 0, 1024, 1024, -64, -1024, 1024, -64, -1024, -1024, -64, 1024, -1024, -64, 1024, 1024, -64, -1024, -1024, -64, 1024, -1024, 0, 1024, -1024, -64, -1024, -1024, -64, -1024, -1024, 0, 1024, -1024, 0, -1024, -1024, -64, -1024, 1024, 0, -1024, -1024, 0, -1024, -1024, -64, -1024, 1024, -64, -1024, 1024, 0, -1024, -1024, -64) data = PackedVector3Array(-504, -64, 256, -504, -64, 128, -504, -192, 128, -504, -192, 256, -504, -64, 256, -504, -192, 128, -504, -64, 256, -512, -64, 256, -512, -64, 128, -504, -64, 128, -504, -64, 256, -512, -64, 128, -504, -64, 256, -504, -192, 256, -512, -192, 256, -512, -64, 256, -504, -64, 256, -512, -192, 256, -504, -64, 128, -512, -64, 128, -512, -192, 128, -504, -192, 128, -504, -64, 128, -512, -192, 128, -504, -192, 256, -504, -192, 128, -512, -192, 128, -512, -192, 256, -504, -192, 256, -512, -192, 128, -512, -64, 256, -512, -192, 256, -512, -192, 128, -512, -64, 128, -512, -64, 256, -512, -192, 128, -128, 64, 8, -128, 64, 0, -128, -320, 0, -128, -320, 8, -128, 64, 8, -128, -320, 0, -128, 64, 8, -512, 64, 8, -512, 64, 0, -128, 64, 0, -128, 64, 8, -512, 64, 0, -128, 64, 8, -128, -320, 8, -512, -320, 8, -512, 64, 8, -128, 64, 8, -512, -320, 8, -128, 64, 0, -512, 64, 0, -512, -320, 0, -128, -320, 0, -128, 64, 0, -512, -320, 0, -128, -320, 8, -128, -320, 0, -512, -320, 0, -512, -320, 8, -128, -320, 8, -512, -320, 0, -512, 64, 8, -512, -320, 8, -512, -320, 0, -512, 64, 0, -512, 64, 8, -512, -320, 0, -512, 64, 392, -512, 64, 8, -512, -320, 8, -512, -320, 392, -512, 64, 392, -512, -320, 8, -512, 64, 392, -520, 64, 392, -520, 64, 8, -512, 64, 8, -512, 64, 392, -520, 64, 8, -512, 64, 392, -512, -320, 392, -520, -320, 392, -520, 64, 392, -512, 64, 392, -520, -320, 392, -512, 64, 8, -520, 64, 8, -520, -320, 8, -512, -320, 8, -512, 64, 8, -520, -320, 8, -520, 64, 392, -520, -320, 392, -520, -320, 8, -520, 64, 8, -520, 64, 392, -520, -320, 8, -512, -320, 392, -512, -320, 8, -520, -320, 8, -520, -320, 392, -512, -320, 392, -520, -320, 8, 512, 1024, 416, 512, 1024, 96, 512, 1016, 96, 512, 1016, 416, 512, 1024, 416, 512, 1016, 96, 512, 1016, 96, 512, 1024, 96, 512, 1016, 0, 512, 1024, 96, 512, 1024, 0, 512, 1016, 0, -512, 1024, 96, 512, 1024, 96, 512, 1024, 416, 512, 1024, 96, 16, 1024, 96, 16, 1024, 0, 512, 1024, 96, 16, 1024, 0, 512, 1024, 0, -512, 1024, 96, 512, 1024, 416, -512, 1024, 416, -32, 1024, 96, -512, 1024, 96, -512, 1024, 0, -32, 1024, 96, -512, 1024, 0, -32, 1024, 0, 512, 1024, 96, 512, 1016, 96, 16, 1016, 96, 16, 1024, 96, 512, 1024, 96, 16, 1016, 96, 512, 1024, 0, 16, 1024, 0, 16, 1016, 0, 512, 1016, 0, 512, 1024, 0, 16, 1016, 0, 512, 1016, 416, 512, 1016, 96, -512, 1016, 96, 512, 1016, 96, 512, 1016, 0, 16, 1016, 0, 512, 1016, 96, 16, 1016, 0, 16, 1016, 96, 512, 1016, 416, -512, 1016, 96, -512, 1016, 416, -512, 1016, 0, -512, 1016, 96, -32, 1016, 96, -512, 1016, 0, -32, 1016, 96, -32, 1016, 0, 16, 1024, 96, 16, 1016, 96, 16, 1016, 0, 16, 1024, 0, 16, 1024, 96, 16, 1016, 0, -32, 1024, 96, -32, 1024, 0, -32, 1016, 0, -32, 1016, 96, -32, 1024, 96, -32, 1016, 0, 512, 1024, 416, 512, 1016, 416, -512, 1016, 416, -512, 1024, 416, 512, 1024, 416, -512, 1016, 416, -32, 1024, 96, -32, 1016, 96, -512, 1016, 96, -512, 1024, 96, -32, 1024, 96, -512, 1016, 96, 512, 1024, 96, -512, 1024, 96, -512, 1016, 96, 512, 1016, 96, 512, 1024, 96, -512, 1016, 96, -512, 1024, 416, -512, 1016, 416, -512, 1016, 96, -512, 1024, 96, -512, 1024, 416, -512, 1016, 96, -512, 1024, 96, -512, 1016, 96, -512, 1016, 0, -512, 1024, 0, -512, 1024, 96, -512, 1016, 0, -32, 1024, 0, -512, 1024, 0, -512, 1016, 0, -32, 1016, 0, -32, 1024, 0, -512, 1016, 0, 1024, 1024, 0, 1024, 1024, -64, 1024, -1024, -64, 1024, -1024, 0, 1024, 1024, 0, 1024, -1024, -64, 1024, 1024, 0, -1024, 1024, 0, -1024, 1024, -64, 1024, 1024, -64, 1024, 1024, 0, -1024, 1024, -64, 1024, 1024, 0, 1024, -1024, 0, -1024, -1024, 0, -1024, 1024, 0, 1024, 1024, 0, -1024, -1024, 0, 1024, 1024, -64, -1024, 1024, -64, -1024, -1024, -64, 1024, -1024, -64, 1024, 1024, -64, -1024, -1024, -64, 1024, -1024, 0, 1024, -1024, -64, -1024, -1024, -64, -1024, -1024, 0, 1024, -1024, 0, -1024, -1024, -64, -1024, 1024, 0, -1024, -1024, 0, -1024, -1024, -64, -1024, 1024, -64, -1024, 1024, 0, -1024, -1024, -64)
@ -45,7 +46,8 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -20.48
momentary = true momentary = true
released_material = SubResource("StandardMaterial3D_pr3ys") released_material = SubResource("StandardMaterial3D_pr3ys")
pressed_material = SubResource("StandardMaterial3D_tselo") pressed_material = SubResource("StandardMaterial3D_tselo")
sound = ExtResource("6_dw4i0") press_sound = ExtResource("6_dw4i0")
release_sound = ExtResource("7_qprql")
volume = -10.0 volume = -10.0
[node name="CardboardKreb" parent="." instance=ExtResource("6_8wwor")] [node name="CardboardKreb" parent="." instance=ExtResource("6_8wwor")]