mirror of https://github.com/axmolengine/axmol.git
Add checked lua codes for issue #10107
This commit is contained in:
parent
a74c75ae7b
commit
01bfe09c05
|
@ -247,6 +247,16 @@ function TestChangePlaySection:onEnter()
|
||||||
node:setScale(0.2)
|
node:setScale(0.2)
|
||||||
node:setPosition(VisibleRect:center())
|
node:setPosition(VisibleRect:center())
|
||||||
|
|
||||||
|
action:addAnimationInfo(ccs.AnimationInfo("stand", 0 , 40))
|
||||||
|
action:addAnimationInfo(ccs.AnimationInfo("walk", 41 , 81))
|
||||||
|
action:addAnimationInfo(ccs.AnimationInfo("killall", 174, 249))
|
||||||
|
|
||||||
|
assert(action:IsAnimationInfoExists("stand") == true, "stand animation didn't exist")
|
||||||
|
action:play("stand", true)
|
||||||
|
assert(action:getAnimationInfo("stand").endIndex == 40, "endIndex of animationInfo is not 40")
|
||||||
|
action:removeAnimationInfo("stand")
|
||||||
|
assert(action:IsAnimationInfoExists("stand") == false, "stand animation has already existed")
|
||||||
|
|
||||||
local function onTouchesEnded(touches, event)
|
local function onTouchesEnded(touches, event)
|
||||||
if action:getStartFrame() == 0 then
|
if action:getStartFrame() == 0 then
|
||||||
action:gotoFrameAndPlay(41, 81, true)
|
action:gotoFrameAndPlay(41, 81, true)
|
||||||
|
|
Loading…
Reference in New Issue