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


                ETCold.UnityLogger gen_to_be_invoked = (ETCold.UnityLogger)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string _msg = LuaAPI.lua_tostring(L, 2);

                    gen_to_be_invoked.Error(
                        _msg);



                    return(0);
                }
                if (gen_param_count == 2 && translator.Assignable <System.Exception>(L, 2))
                {
                    System.Exception _e = (System.Exception)translator.GetObject(L, 2, typeof(System.Exception));

                    gen_to_be_invoked.Error(
                        _e);



                    return(0);
                }
                if (gen_param_count >= 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && (LuaTypes.LUA_TNONE == LuaAPI.lua_type(L, 3) || translator.Assignable <object>(L, 3)))
                {
                    string   _message = LuaAPI.lua_tostring(L, 2);
                    object[] _args    = translator.GetParams <object>(L, 3);

                    gen_to_be_invoked.Error(
                        _message,
                        _args);



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

            return(LuaAPI.luaL_error(L, "invalid arguments to ETCold.UnityLogger.Error!"));
        }
Beispiel #2
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    ETCold.UnityLogger gen_ret = new ETCold.UnityLogger();
                    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 ETCold.UnityLogger constructor!"));
        }