30 lines
829 B
GDScript
30 lines
829 B
GDScript
extends Node2D
|
|
|
|
@onready var animation_player: AnimationPlayer = $AnimationPlayer
|
|
@onready var sfx_player: AudioStreamPlayer = $SFXPlayer
|
|
var stream_player: AudioStreamPlaybackInteractive
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
stream_player = sfx_player.get_stream_playback() as AudioStreamPlaybackInteractive
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|
|
|
|
func play_list_up_sfx() -> void:
|
|
stream_player.switch_to_clip_by_name("list_up")
|
|
|
|
func play_list_down_sfx() -> void:
|
|
stream_player.switch_to_clip_by_name("list_down")
|
|
|
|
|
|
func _on_guest_list_mouse_entered() -> void:
|
|
animation_player.play("guest_list_up")
|
|
|
|
|
|
func _on_guest_list_mouse_exited() -> void:
|
|
animation_player.play("guest_list_down")
|