Added UI sound effects
This commit is contained in:
10
client/ui/button/Button.gd
Normal file
10
client/ui/button/Button.gd
Normal file
@ -0,0 +1,10 @@
|
||||
extends Button
|
||||
|
||||
@export var hover: AudioStream
|
||||
@export var click: AudioStream
|
||||
|
||||
func _ready():
|
||||
assert(hover)
|
||||
assert(click)
|
||||
mouse_entered.connect(Audio.play_ui.bind(hover))
|
||||
button_down.connect(Audio.play_ui.bind(click))
|
15
client/ui/button/Button.tscn
Normal file
15
client/ui/button/Button.tscn
Normal file
@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bul4bacam6s78"]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/button/Button.gd" id="1_75erh"]
|
||||
[ext_resource type="AudioStream" uid="uid://bxg5jpc7glw8s" path="res://assets/audio/ui/hover.wav" id="2_7ak8k"]
|
||||
[ext_resource type="AudioStream" uid="uid://bfa480mk0nwj" path="res://assets/audio/ui/click.wav" id="3_o67x3"]
|
||||
|
||||
[node name="Button" type="Button"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_75erh")
|
||||
hover = ExtResource("2_7ak8k")
|
||||
click = ExtResource("3_o67x3")
|
Reference in New Issue
Block a user