Lua - Reflection - Get list of functions/fields on an object?

前端 未结 4 1169
北恋
北恋 2020-12-23 16:57

I\'m new to Lua and dealing with Lua as a scripting language in an alpha release of a program. The developer is unresponsive and I need to get a list of functions provided b

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-23 17:53

    In Lua, to view the members of a object, you can use:

    for key,value in pairs(o) do
        print("found member " .. key);
    end
    

    Unfortunately I don't know if this will work for objects imported from C++.

提交回复
热议问题