Example #1
0
        static int _m_OnCreate(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LuaNormalBehaiour gen_to_be_invoked = (LuaNormalBehaiour)translator.FastGetCSObj(L, 1);



                {
                    XLua.LuaTable _luains = (XLua.LuaTable)translator.GetObject(L, 2, typeof(XLua.LuaTable));
                    XLua.LuaTable _param  = (XLua.LuaTable)translator.GetObject(L, 3, typeof(XLua.LuaTable));

                    var gen_ret = gen_to_be_invoked.OnCreate(_luains, _param);
                    translator.Push(L, gen_ret);



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

                LuaNormalBehaiour gen_to_be_invoked = (LuaNormalBehaiour)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.LuaClass);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Example #3
0
    static public LuaTable CreateIns(GameObject go, LuaTable lua_class, LuaTable param)
    {
        LuaTable ret = null;

        do
        {
            LuaNormalBehaiour mb = go.AddComponent <LuaNormalBehaiour>();
            if (null == mb)
            {
                ZLog.E(go, "create {0} err", lua_class);
                break;
            }
            ret = mb.OnCreate(lua_class, param);
        }while(false);
        return(ret);
    }
Example #4
0
    static public LuaTable Attach(GameObject go, string stript_name, LuaTable param)
    {
        LuaTable ret = null;

        do
        {
            LuaNormalBehaiour mb = go.AddComponent <LuaNormalBehaiour>();
            if (null == mb)
            {
                ZLog.E(go, "create {0} err", stript_name);
                break;
            }
            ret = mb.OnLoad(stript_name, param);
        }while(false);
        return(ret);
    }
Example #5
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    var gen_ret = new LuaNormalBehaiour();
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to LuaNormalBehaiour constructor!"));
        }
Example #6
0
        static int _m_OnLoad(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LuaNormalBehaiour gen_to_be_invoked = (LuaNormalBehaiour)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TTABLE))
                {
                    string        _stript_name = LuaAPI.lua_tostring(L, 2);
                    XLua.LuaTable _param       = (XLua.LuaTable)translator.GetObject(L, 3, typeof(XLua.LuaTable));

                    var gen_ret = gen_to_be_invoked.OnLoad(_stript_name, _param);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TTABLE) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TTABLE))
                {
                    XLua.LuaTable _luains = (XLua.LuaTable)translator.GetObject(L, 2, typeof(XLua.LuaTable));
                    XLua.LuaTable _param  = (XLua.LuaTable)translator.GetObject(L, 3, typeof(XLua.LuaTable));

                    var gen_ret = gen_to_be_invoked.OnLoad(_luains, _param);
                    translator.Push(L, gen_ret);



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

            return(LuaAPI.luaL_error(L, "invalid arguments to LuaNormalBehaiour.OnLoad!"));
        }
Example #7
0
        static int _m_DoUnload(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                LuaNormalBehaiour gen_to_be_invoked = (LuaNormalBehaiour)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.DoUnload(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #8
0
        static int _m_AttachIns_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    UnityEngine.GameObject _go     = (UnityEngine.GameObject)translator.GetObject(L, 1, typeof(UnityEngine.GameObject));
                    XLua.LuaTable          _luains = (XLua.LuaTable)translator.GetObject(L, 2, typeof(XLua.LuaTable));
                    XLua.LuaTable          _param  = (XLua.LuaTable)translator.GetObject(L, 3, typeof(XLua.LuaTable));

                    var gen_ret = LuaNormalBehaiour.AttachIns(_go, _luains, _param);
                    translator.Push(L, gen_ret);



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