LUA script table table

Similar to the structure
defined, for example the name of a table with a table name Age method attributes people eating and sleeping
people = {
name = 'ZSY',
Age = 18 is,
Tall = '1.78',
eating function = ()
Print ( 'eat' )
End,
sleep function = ()
Print ( 'sleep')
End

people. meal () is to call the corresponding methods
if not defined variable is an array manner, for example, call people [4]

Published 49 original articles · won praise 3 · Views 5612

Guess you like

Origin blog.csdn.net/nb_zsy/article/details/104259416