mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 16:48:43 +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 "").."'")
|
print(entry.trackIndex.." event: "..entry.animation.name..", "..event.data.name..", "..event.intValue..", "..event.floatValue..", '"..(event.stringValue or "").."'")
|
||||||
end
|
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 the skeleton an animation state
|
||||||
return { skeleton = skeleton, state = animationState }
|
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);
|
animationStateData.setMix("jump", "run", 0.4);
|
||||||
animationState.setAnimation(0, "walk", true);
|
animationState.setAnimation(0, "walk", true);
|
||||||
var jumpEntry = animationState.addAnimation(0, "jump", false, 3);
|
var jumpEntry = animationState.addAnimation(0, "jump", false, 3);
|
||||||
animationState.addAnimation(0, "run", true);
|
animationState.addAnimation(0, "run", true, 0);
|
||||||
} else {
|
} else {
|
||||||
animationState.setAnimation(0, initialAnimation, true);
|
animationState.setAnimation(0, initialAnimation, true);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user