Merge branch 'master' of ssh://play.qtechofficial.com:9940/funnymemellama/funnymemellama

This commit is contained in:
zombie maniac 2023-10-01 23:43:16 -04:00
commit e92d7bea95
Signed by untrusted user: nbrooks211
GPG key ID: F43C85C0DF0C334E

View file

@ -18,11 +18,9 @@ var pressed_material: StandardMaterial3D = null
# Not sure why this doesnt work...
@export_subgroup('Sound')
@export
var sound: AudioStream = null :
get:
return $AudioStreamPlayer3D.stream
set(value):
$AudioStreamPlayer3D.stream = value
var press_sound: AudioStream = null
@export
var release_sound: AudioStream = null
@export_range(-80, 80, 1, "suffix:dB")
var volume = 0.0 :
@ -52,8 +50,9 @@ func interact(other):
if _triggered:
return
_triggered = true
triggered.emit(other)
_sound.stream = press_sound
_sound.play()
_anim.play('trigger')
_button.material = pressed_material
@ -64,8 +63,10 @@ func _on_anim_finished(name):
_button.material = released_material
_resetting = false
_triggered = false
if momentary and _triggered:
_sound.stop()
_sound.stream = release_sound
_sound.play()
_anim.play_backwards('trigger')
_resetting = true