Exemplo n.º 1
0
        static int _m_GetCaster(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                XLua.ObjectCasters gen_to_be_invoked = (XLua.ObjectCasters)translator.FastGetCSObj(L, 1);



                {
                    System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type));

                    XLua.ObjectCast gen_ret = gen_to_be_invoked.GetCaster(_type);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemplo n.º 2
0
        static int _m_AddCaster(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                XLua.ObjectCasters gen_to_be_invoked = (XLua.ObjectCasters)translator.FastGetCSObj(L, 1);



                {
                    System.Type     _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type));
                    XLua.ObjectCast _oc   = translator.GetDelegate <XLua.ObjectCast>(L, 3);

                    gen_to_be_invoked.AddCaster(_type, _oc);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }