Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR LUA

lua object

SomeClass = { id = "some_class" }
SomeClass.__index = SomeClass
function SomeClass:Create()
    local this = {}
    setmetatable(this, SomeClass)
    return this
end

c1 = SomeClass:Create()
c2 = SomeClass:Create()

print(c1.id) -- "some_class"
print(c2.id) -- "some_class"
 
PREVIOUS NEXT
Tagged: #lua #object
ADD COMMENT
Topic
Name
9+3 =