Beispiel #1
0
        private static void PushUserData(IntPtr L, object o, int reference)
        {
            ObjectTranslator objectTranslator = ObjectTranslator.Get(L);
            int index;

            if (objectTranslator.Getudata(o, out index) && LuaDLL.tolua_pushudata(L, index))
            {
                return;
            }
            index = objectTranslator.AddObject(o);
            LuaDLL.tolua_pushnewudata(L, reference, index);
        }
Beispiel #2
0
        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;
                }
            }

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