forked from team-sg/hero-mark-2
menu sounds
This commit is contained in:
parent
098ab161de
commit
ba12787fcb
10 changed files with 63 additions and 16 deletions
12
objects/hud/menu_sounds.gd
Normal file
12
objects/hud/menu_sounds.gd
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends Node
|
||||
|
||||
var can_play: bool = false
|
||||
|
||||
func play_select_sound():
|
||||
if can_play:
|
||||
$"%SelectSound".play()
|
||||
else:
|
||||
can_play = true
|
||||
|
||||
func play_confirm_sound():
|
||||
$"%ConfirmSound".play()
|
18
objects/hud/menu_sounds.tscn
Normal file
18
objects/hud/menu_sounds.tscn
Normal file
|
@ -0,0 +1,18 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://objects/hud/menu_sounds.gd" type="Script" id=1]
|
||||
[ext_resource path="res://audio/sounds/confirm.wav" type="AudioStream" id=2]
|
||||
[ext_resource path="res://audio/sounds/select.wav" type="AudioStream" id=3]
|
||||
|
||||
[node name="MenuSounds" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="SelectSound" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource( 3 )
|
||||
volume_db = -8.0
|
||||
|
||||
[node name="ConfirmSound" type="AudioStreamPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource( 2 )
|
||||
volume_db = -8.0
|
Loading…
Add table
Add a link
Reference in a new issue