Beispiel #1
0
        protected static void _BeginTypeMembers(Type type, LuaCSFunction constructor)
        {
            IntPtr L = LuaState.L;

            LuaBindMetatable typeMetatable = LuaState.Bindings.GetMetatable(type, LuaBindMetatableType.Type);

            typeMetatable.Push();                                                                       // |mt

            if (constructor != null)
            {
                LuaLib.lua_pushstring(L, "__call");                             // |mt|s
                LuaLib.lua_pushcsfunction(L, constructor);                      // |mt|s|csf
                LuaLib.lua_rawset(L, -3);                                       // |mt			// mt.__call = constructor
            }
        }
Beispiel #2
0
        protected static void _BeginInstanceMembers(Type type)
        {
            LuaBindMetatable instanceMetatable = LuaState.Bindings.GetMetatable(type, LuaBindMetatableType.Instance);

            instanceMetatable.Push();                                                                   // |mt
        }