function BgMap:AsyncLater()
self:loadEasyTileMap(self._mapData)
--self:addMapSpriteFram()
--self:loadBottomSkyMap(self._mapData)
--self:loadUpSkyMap(self._mapData)
--local moveBy = cc.MoveBy:create(0, cc.p(0, 5))
self.m_runCoroutine = coroutine.wrap(function()
--做加载逻辑
self:loadNpcMap(self._mapData)
coroutine.yield()
--做加载逻辑
self:changeNpcToIdx()
coroutine.yield()
--做加载逻辑
self:loadEffectMap(self._mapData)
coroutine.yield()
self:changeEffectToIdx()
coroutine.yield()
self:loadTouchMap(self._mapData)
coroutine.yield()
self:loadMaskMap(self._mapData)
coroutine.yield()
self:loadAreaMap(self._mapData)
coroutine.yield()
self.m_gameView:AsyncLater()--2.8秒
self:loadBuildMap(self._mapData)
self.m_runCoroutine = nil
end)
self.m_runCoroutine()
if g_sceneEff then g_sceneEff:setPosition(display.cx, display.cy - 5) end
print("pos 5")
self.m_runCoroutine()
--更新进度条
if g_sceneEff then g_sceneEff:setPosition(display.cx, display.cy - 25) end
print("pos 25")
self.m_runCoroutine()
--更新进度条
if g_sceneEff then g_sceneEff:setPosition(display.cx, display.cy - 45) end
print("pos 45")
self.m_runCoroutine()
--更新进度条
if g_sceneEff then g_sceneEff:setPosition(display.cx, display.cy - 65) end
print("pos 65")
self.m_runCoroutine()
if g_sceneEff then g_sceneEff:setPosition(display.cx, display.cy - 85) end
print("pos 85")
self.m_runCoroutine()
if g_sceneEff then g_sceneEff:setPosition(display.cx, display.cy - 105) end
print("pos 105")
self.m_runCoroutine()
if g_sceneEff then g_sceneEff:setPosition(display.cx, display.cy - 125) end
print("pos 125")
self.m_runCoroutine()
if g_sceneEff then g_sceneEff:setPosition(display.cx, display.cy - 145) end
print("pos 145")
g_endLoading()
end
网友评论