extends Control

@export var photos: Array[Texture2D]
@export var photo_sound: Array[AudioStream]
@export var destroy_sound: AudioStream

var is_visible = false

func show_picture(index: int):
	is_visible = true
	$FotoTest.texture = photos[index]
	$AnimationPlayer.play("appear")
	$AudioStreamPlayer.stream = photo_sound.pick_random()
	$AudioStreamPlayer.play()

func hide_picture():
	if !is_visible: return
	$AnimationPlayer.play("disappear")
	is_visible = false
	$AudioStreamPlayer.stream = destroy_sound
	$AudioStreamPlayer.play()
