当transition传入random的时候,type(t)一直返回table,但是t,t可能为nil,直接报错了
function display.wrapScene(scene, transition, time, more)
local key = string.upper(tostring(transition))
if key == "RANDOM" then
local keys = table.keys(display.SCENE_TRANSITIONS)
key = keys
end
if display.SCENE_TRANSITIONS then
local t = display.SCENE_TRANSITIONS
time = time or 0.2
more = more or t
if type(t) == "table" and (t ~= nil and t ~= nil) then
scene = t:create(time, scene, more)
else
scene = t:create(time, scene)
end
else
error(string.format("display.wrapScene() - invalid transition %s", tostring(transition)))
end
return scene
end