how to find out all properties of an object in lua?

前端 未结 3 994
别那么骄傲
别那么骄傲 2021-02-20 07:15

Is there any way of getting all the non-nil parameters / properties of an object? I found this: getmetadata(self.xxxx) and i am looking for something like: ge

3条回答
  •  自闭症患者
    2021-02-20 07:35

    I believe objects are just a table, so you should be able to iterate over the properties as any other table:

    for i,v in ipairs(your_object) do body end
    

提交回复
热议问题