mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-07 15:54:56 +08:00
[lua] Ported AnimationState changes
This commit is contained in:
parent
a7fe570148
commit
aca4060fad
@ -61,7 +61,15 @@ function loadSkeleton(atlasFile, jsonFile, x, y, scale, animation, skin)
|
||||
print(entry.trackIndex.." event: "..entry.animation.name..", "..event.data.name..", "..event.intValue..", "..event.floatValue..", '"..(event.stringValue or "").."'")
|
||||
end
|
||||
|
||||
animationState:setAnimationByName(0, animation, true)
|
||||
if atlasFile == "spineboy.atlas" then
|
||||
animationStateData:setMix("walk", "jump", 0.4)
|
||||
animationStateData:setMix("jump", "run", 0.4);
|
||||
animationState:setAnimationByName(0, "walk", true)
|
||||
local jumpEntry = animationState:addAnimationByName(0, "jump", false, 3)
|
||||
animationState:addAnimationByName(0, "run", true, 0)
|
||||
else
|
||||
animationState:setAnimationByName(0, animation, true)
|
||||
end
|
||||
|
||||
-- return the skeleton an animation state
|
||||
return { skeleton = skeleton, state = animationState }
|
||||
|
||||
2666
spine-ts/build/spine-webgl.d.ts
vendored
2666
spine-ts/build/spine-webgl.d.ts
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -123,7 +123,7 @@ function loadSkeleton (name, initialAnimation, premultipliedAlpha, skin) {
|
||||
animationStateData.setMix("jump", "run", 0.4);
|
||||
animationState.setAnimation(0, "walk", true);
|
||||
var jumpEntry = animationState.addAnimation(0, "jump", false, 3);
|
||||
animationState.addAnimation(0, "run", true);
|
||||
animationState.addAnimation(0, "run", true, 0);
|
||||
} else {
|
||||
animationState.setAnimation(0, initialAnimation, true);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user