init
This commit is contained in:
commit
b99855351d
434 changed files with 50357 additions and 0 deletions
21
scripts/npc/photo.gd
Normal file
21
scripts/npc/photo.gd
Normal file
|
@ -0,0 +1,21 @@
|
|||
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()
|
Loading…
Add table
Add a link
Reference in a new issue