Added UI sound effects
This commit is contained in:
15
client/audio/Audio.gd
Normal file
15
client/audio/Audio.gd
Normal file
@ -0,0 +1,15 @@
|
||||
extends Node
|
||||
|
||||
var ui: AudioStreamPlayer
|
||||
|
||||
func _ready():
|
||||
ui = $UI
|
||||
assert(ui)
|
||||
|
||||
func play_ui(stream: AudioStream):
|
||||
ui.stream = stream
|
||||
ui.play()
|
||||
|
||||
func mute(enabled: bool):
|
||||
var master_sound = AudioServer.get_bus_index("Master")
|
||||
AudioServer.set_bus_mute(master_sound, enabled)
|
19
client/audio/Audio.tscn
Normal file
19
client/audio/Audio.tscn
Normal file
@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ev7uecbluell"]
|
||||
|
||||
[ext_resource type="Script" path="res://audio/Audio.gd" id="1_nv42i"]
|
||||
[ext_resource type="AudioStream" uid="uid://b36mntcqlt553" path="res://assets/audio/ambience/Wind-Vegetation-Leaves-Gusts.wav" id="2_fkia1"]
|
||||
|
||||
[node name="Audio" type="Node"]
|
||||
process_thread_group = 2
|
||||
process_thread_group_order = 0
|
||||
process_thread_messages = 0
|
||||
script = ExtResource("1_nv42i")
|
||||
|
||||
[node name="Ambience" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("2_fkia1")
|
||||
autoplay = true
|
||||
bus = &"Ambience"
|
||||
|
||||
[node name="UI" type="AudioStreamPlayer" parent="."]
|
||||
max_polyphony = 3
|
||||
bus = &"UI"
|
Reference in New Issue
Block a user