Esempio n. 1
0
        internal static LuaTValue GetLuaObject(string luaAccessorCode)
        {
            LuaTable curTable = Lua.State.Globals;

            string[] split = luaAccessorCode.Split('.');
            for (int i = 0; i < split.Length - 1; i++)
            {
                if (curTable == null)
                {
                    return(null);
                }

                LuaTValue val = curTable.GetField(split[i]);
                if (val == null || val.Type != LuaType.Table)
                {
                    return(null);
                }

                curTable = val.Value.Table;
            }

            return(curTable.GetField(split.Last()));
        }