表弟-周威喜欢使用的动作连续播放 复制物品到屏幕移动

function UICityNew:getItemOver()
    local uiMain = g_monomerHelp:getUIDicController()
    local bgPos = uiMain:getBagPos()
    local moveAnimation = function()
        local moveItems = {}
        for i, v in ipairs(self.allItems) do
            if #moveItems < 3 then
                table.insert(moveItems, v)
            else
                break
            end
        end
        table.oneByOne(moveItems, function(item, nextCallback)
            local itemPos = item:getParent():convertToWorldSpace(cc.p(item:getPosition()))
            local itemCopy = item:clone():pos(itemPos.x, itemPos.y):addTo(display.getRunningScene(), 999)
            cca.builder()
                :begin("spawn")
                    :moveTo(0.5, bgPos.x, bgPos.y - 20)
                    :scaleTo(0.5, 0.4)
                    :begin():delay(0):cb(nextCallback):done()
                :done()
                :removeSelf()
                :addTo(itemCopy)
            --item:hide()
        end, function()
            
        end)
    end
   
    moveAnimation()    
end

你可能感兴趣的:(表弟-周威喜欢使用的动作连续播放 复制物品到屏幕移动)