Unit = {状态 = {Name = ""}, --状态参数 = {}, --参数}-- Unit.State.Name = ""function 状态机(状态,Name,当前Name) --状态机if 状态[Name] ~= nil thenreturn 状态[Name](当前Name);endreturn "Error"endfunction floatwinrun()Unit.状态.Name = "Test"while true doUnit.状态.Name = 状态机(Unit.状态,Unit.状态.Name,Unit.参数[Unit.状态.Name])logcat("当前状态:"..Unit.状态.Name)sleep(1000)endendfunction text1(当前Name)return "text1"end-- Unit.参数.Test = {-- account = text1-- }function Unit.状态.Test(当前Name)return "Test"endfloatwinrun()
