Esempio n. 1
0
        private void PushUserData(object o, int meta)
        {
            int index;

            if (translator.GetUdata(o, out index))
            {
                if (LuaDLL.tolua_pushudata(L, index))
                {
                    return;
                }

                translator.DestroyUdata(index);
            }

            index = translator.AddObject(o);
            LuaDLL.tolua_pushnewudata(L, meta, index);
        }
Esempio n. 2
0
        public static void PushUserData(IntPtr L, object o, int reference)
        {
            int index;
            ObjectTranslator translator = ObjectTranslator.Get(L);

            if (translator.GetUdata(o, out index))
            {
                if (LuaDLL.tolua_pushudata(L, index))
                {
                    return;
                }

                translator.DestroyUdata(index);
            }

            index = translator.AddObject(o);
            LuaDLL.tolua_pushnewudata(L, reference, index);
        }