Example #1
0
    /// <summary>
    /// 初始化Lua代码加载路径
    /// </summary>
    void InitLuaPath()
    {
        if (AppConst.DebugMode)
        {
            string rootPath = AppConst.FrameworkRoot;
            lua.AddSearchPath(rootPath + "/Lua");
            lua.AddSearchPath(rootPath + "/ToLua/Lua");
        }
        else
        {
            lua.AddSearchPath(Util.DataPath + "lua");

            foreach (var x in AppConst.ResourcesPath)
            {
                lua.AddRecursiveSearchPath(x);
            }
        }
    }