18 lines
584 B
GDScript3
18 lines
584 B
GDScript3
|
|
extends SpineSprite
|
||
|
|
|
||
|
|
@export var time_scale: float = 1.0
|
||
|
|
@onready var animation_state: SpineAnimationState = get_animation_state()
|
||
|
|
var o = GDRx.on_input_as_observable(self)\
|
||
|
|
.filter(func (e): return e is InputEventKey or e is InputEventMouseButton)\
|
||
|
|
.subscribe(change_scene)\
|
||
|
|
.dispose_with(self)
|
||
|
|
|
||
|
|
func _ready() -> void:
|
||
|
|
animation_state.set_animation("idle", true)
|
||
|
|
animation_state.set_time_scale(time_scale)
|
||
|
|
|
||
|
|
func change_scene(event: InputEvent):
|
||
|
|
await get_tree().create_timer(1.0).timeout
|
||
|
|
get_tree().change_scene_to_file("res://assets/scenes/main.tscn")
|
||
|
|
o.dispose()
|