forked from funnymemellama/funnymemellama
Merge branch 'master' of ssh://play.qtechofficial.com:9940/funnymemellama/funnymemellama
This commit is contained in:
commit
e92d7bea95
1 changed files with 8 additions and 7 deletions
11
Button.gd
11
Button.gd
|
@ -18,11 +18,9 @@ var pressed_material: StandardMaterial3D = null
|
||||||
# Not sure why this doesnt work...
|
# Not sure why this doesnt work...
|
||||||
@export_subgroup('Sound')
|
@export_subgroup('Sound')
|
||||||
@export
|
@export
|
||||||
var sound: AudioStream = null :
|
var press_sound: AudioStream = null
|
||||||
get:
|
@export
|
||||||
return $AudioStreamPlayer3D.stream
|
var release_sound: AudioStream = null
|
||||||
set(value):
|
|
||||||
$AudioStreamPlayer3D.stream = value
|
|
||||||
|
|
||||||
@export_range(-80, 80, 1, "suffix:dB")
|
@export_range(-80, 80, 1, "suffix:dB")
|
||||||
var volume = 0.0 :
|
var volume = 0.0 :
|
||||||
|
@ -54,6 +52,7 @@ func interact(other):
|
||||||
_triggered = true
|
_triggered = true
|
||||||
|
|
||||||
triggered.emit(other)
|
triggered.emit(other)
|
||||||
|
_sound.stream = press_sound
|
||||||
_sound.play()
|
_sound.play()
|
||||||
_anim.play('trigger')
|
_anim.play('trigger')
|
||||||
_button.material = pressed_material
|
_button.material = pressed_material
|
||||||
|
@ -66,6 +65,8 @@ func _on_anim_finished(name):
|
||||||
_triggered = false
|
_triggered = false
|
||||||
|
|
||||||
if momentary and _triggered:
|
if momentary and _triggered:
|
||||||
|
_sound.stop()
|
||||||
|
_sound.stream = release_sound
|
||||||
_sound.play()
|
_sound.play()
|
||||||
_anim.play_backwards('trigger')
|
_anim.play_backwards('trigger')
|
||||||
_resetting = true
|
_resetting = true
|
||||||
|
|
Loading…
Reference in a new issue