unity lua table存储function,进行批量处理
作者:
好怕怕 | 来源:发表于
2020-11-14 10:25 被阅读0次local type = {a=1, b=2}
function aEnter()
print("aEnter")
end
function aExit()
print("aExit")
end
function bEnter(num)
print("bEnter:"..num)
end
function bExit()
print("bExit")
end
local func =
{
[type.a] = { Enter = aEnter, Exit = aExit },
[type.b] = { Enter = bEnter, Exit = bExit },
}
print( func[type.a].Enter())
print( func[type.b].Enter(101))
本文标题:unity lua table存储function,进行批量处理
本文链接:https://www.haomeiwen.com/subject/puiibktx.html
网友评论