mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
[godot] Register signal handlers before queuing animations.
This commit is contained in:
parent
425e5a5f2c
commit
5f9f684408
@ -24,15 +24,16 @@ func _animation_event(sprite: SpineSprite, animation_state: SpineAnimationState,
|
||||
|
||||
func _ready():
|
||||
var spineboy = $Spineboy
|
||||
var animation_state = spineboy.get_animation_state()
|
||||
animation_state.set_animation("jump", false, 0)
|
||||
animation_state.add_animation("walk", 0, true, 0)
|
||||
animation_state.add_animation("run", 2, true, 0)
|
||||
|
||||
spineboy.animation_started.connect(_animation_started)
|
||||
spineboy.animation_interrupted.connect(_animation_interrupted)
|
||||
spineboy.animation_ended.connect(_animation_ended)
|
||||
spineboy.animation_completed.connect(_animation_completed)
|
||||
spineboy.animation_disposed.connect(_animation_disposed)
|
||||
spineboy.animation_event.connect(_animation_event)
|
||||
|
||||
var animation_state = spineboy.get_animation_state()
|
||||
animation_state.set_animation("jump", false, 0)
|
||||
animation_state.add_animation("walk", 0, true, 0)
|
||||
animation_state.add_animation("run", 2, true, 0)
|
||||
|
||||
pass
|
||||
|
||||
@ -24,15 +24,16 @@ func _animation_event(sprite: SpineSprite, animation_state: SpineAnimationState,
|
||||
|
||||
func _ready():
|
||||
var spineboy = $Spineboy
|
||||
var animation_state = spineboy.get_animation_state()
|
||||
animation_state.set_animation("jump", false, 0)
|
||||
animation_state.add_animation("walk", 0, true, 0)
|
||||
animation_state.add_animation("run", 2, true, 0)
|
||||
|
||||
spineboy.connect("animation_started", self, "_animation_started")
|
||||
spineboy.connect("animation_interrupted", self, "_animation_interrupted")
|
||||
spineboy.connect("animation_ended", self, "_animation_ended")
|
||||
spineboy.connect("animation_completed", self, "_animation_completed")
|
||||
spineboy.connect("animation_disposed", self, "_animation_disposed")
|
||||
spineboy.connect("animation_event", self, "_animation_event")
|
||||
|
||||
var animation_state = spineboy.get_animation_state()
|
||||
animation_state.set_animation("jump", false, 0)
|
||||
animation_state.add_animation("walk", 0, true, 0)
|
||||
animation_state.add_animation("run", 2, true, 0)
|
||||
|
||||
pass
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user