function exitGame()
local platform = cc.Application:getInstance():getTargetPlatform()
if platform == cc.PLATFORM_OS_IPHONE or platform == cc.PLATFORM_OS_IPAD then -- iOS設備
os.exit()
else
cc.Director:getInstance():endToLua()
end
end