美文网首页
Lua 资源搜索

Lua 资源搜索

作者: 曾令伟 | 来源:发表于2016-04-19 16:50 被阅读39次

    local dir = cc.FileUtils:getInstance():getWritablePath()

    cc.FileUtils:getInstance():addSearchPath(dir,true)

    cc.FileUtils:getInstance():addSearchPath(dir.."/res/",true)

    package.path = package.path .. ";src/"

    cc.FileUtils:getInstance():setPopupNotify(false)

    cc.FileUtils:getInstance():addSearchPath("res/")

    -- Lua 调试输出   自定义 cclog 函数

    local IS_DEBUG = true  -- 是debug模式,则输出信息

    cclog = function(...)

              if not IS_DEBUG then

                           return

               end

                local log_var = string.format(...)

                print(log_var)

    end

    相关文章

      网友评论

          本文标题:Lua 资源搜索

          本文链接:https://www.haomeiwen.com/subject/mtxzlttx.html