setMovementEventCallFunc挂了监听如何取消?
试了setMovementEventCallFunc(nil)不行
3.0 lua代码测试
local function attackerAnimationEvent(armature,movementType,movementID)
local id = movementID
if movementType == ccs.MovementEventType.loopComplete then
if id == “attack” then
armature:stopAllActions()
armature:getAnimation():play(“idel”)
elseif id == “idel” then
armature:getAnimation():setMovementEventCallFunc(nil)
end
end
end
attackerArmature:getAnimation():setMovementEventCallFunc(attackerAnimationEvent)