Skip to content

Commit

Permalink
Auto-Format GDScript
Browse files Browse the repository at this point in the history
  • Loading branch information
monochromia authored and github-actions[bot] committed Apr 16, 2022
1 parent 83154e0 commit f8cc1a9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scripts/Audio.gd
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
extends Node


func _ready():
EventBus.connect("volume_changed", self, "_on_volume_change")
for bus in ["Master", "music", "sfx", "voice"]:
_on_volume_change(bus)


func _on_volume_change(bus: String):
var volume : int = 0
var volume: int = 0
match bus:
"Master": volume = Settings.volume_game
"music": volume = Settings.volume_music
"sfx": volume = Settings.volume_sfx
"voice": volume = Settings.volume_voice
"Master":
volume = Settings.volume_game
"music":
volume = Settings.volume_music
"sfx":
volume = Settings.volume_sfx
"voice":
volume = Settings.volume_voice
AudioServer.set_bus_volume_db(AudioServer.get_bus_index(bus), linear2db(volume / 10.0))

0 comments on commit f8cc1a9

Please sign in to comment.