20 lines
462 B
GDScript
20 lines
462 B
GDScript
extends ColorRect
|
|||
|
|
@export var type: int = 0
|
||
|
|
@export var speed: float = 1
|
||
|
|
|
||
|
|
# Called when the node enters the scene tree for the first time.
|
||
|
|
|
||
|
|
func _ready():
|
||
|
|
if type == 0:
|
||
|
|
$AnimationPlayer.play("fade_in")
|
||
|
|
elif type == 1:
|
||
|
|
$AnimationPlayer.play("fade_out")
|
||
|
|
|
||
|
|
$AnimationPlayer.speed_scale = speed
|
||
|
|
await $AnimationPlayer.animation_finished
|
||
|
|
queue_free()
|
||
|
|
|
||
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
|
func _process(delta):
|
||
|
|
pass
|