Esempio n. 1
0
        int UnityEngineGameObject_m_GetComponentsInParent(RealStatePtr L, int gen_param_count)
        {
            ObjectTranslator translator = this;


            UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1);

            if (gen_param_count == 2 && translator.Assignable <System.Type>(L, 2))
            {
                System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type));

                UnityEngine.Component[] gen_ret = gen_to_be_invoked.GetComponentsInParent(_type);
                translator.Push(L, gen_ret);



                return(1);
            }
            if (gen_param_count == 3 && translator.Assignable <System.Type>(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
            {
                System.Type _type            = (System.Type)translator.GetObject(L, 2, typeof(System.Type));
                bool        _includeInactive = LuaAPI.lua_toboolean(L, 3);

                UnityEngine.Component[] gen_ret = gen_to_be_invoked.GetComponentsInParent(_type, _includeInactive);
                translator.Push(L, gen_ret);



                return(1);
            }


            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.GameObject.GetComponentsInParent!"));
        }
        static int _m_GetComponentsInParent(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.GameObject gen_to_be_invoked = (UnityEngine.GameObject)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <System.Type>(L, 2))
                {
                    System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type));

                    UnityEngine.Component[] gen_ret = gen_to_be_invoked.GetComponentsInParent(
                        _type);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && translator.Assignable <System.Type>(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
                {
                    System.Type _type            = (System.Type)translator.GetObject(L, 2, typeof(System.Type));
                    bool        _includeInactive = LuaAPI.lua_toboolean(L, 3);

                    UnityEngine.Component[] gen_ret = gen_to_be_invoked.GetComponentsInParent(
                        _type,
                        _includeInactive);
                    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 UnityEngine.GameObject.GetComponentsInParent!"));
        }
Esempio n. 3
0
        public static int GetComponentsInParent(IntPtr L)
        {
            int result = 1;
            int count  = LuaDLL.lua_gettop(L);

            if (count == 2 &&
                LuaStatic.CheckType(L, typeof(Type), 2))
            {
                UnityEngine.GameObject obj = LuaStatic.GetObj(L, 1) as UnityEngine.GameObject;
                object      type1          = LuaStatic.GetObj(L, 2);
                Type        arg1           = LuaStatic.GetType(type1);
                IEnumerable objs           = (IEnumerable)obj.GetComponentsInParent(arg1);
                LuaDLL.lua_newtable(L);
                int num2 = 0;
                foreach (var item in objs)
                {
                    LuaStatic.addGameObject2Lua(L, (UnityEngine.Component)item, (string)type1);
                    LuaDLL.lua_pushnumber(L, (double)(++num2));
                    LuaDLL.lua_insert(L, -2);
                    LuaDLL.lua_settable(L, -3);
                }

                return(result);
            }
            if (count == 3 &&
                LuaStatic.CheckType(L, typeof(Type), 2) &&
                LuaStatic.CheckType(L, typeof(Boolean), 3))
            {
                UnityEngine.GameObject obj = LuaStatic.GetObj(L, 1) as UnityEngine.GameObject;
                object      type1          = LuaStatic.GetObj(L, 2);
                Type        arg1           = LuaStatic.GetType(type1);
                Boolean     arg2           = (Boolean)LuaStatic.GetObj(L, 3);
                IEnumerable objs           = (IEnumerable)obj.GetComponentsInParent(arg1, arg2);
                LuaDLL.lua_newtable(L);
                int num2 = 0;
                foreach (var item in objs)
                {
                    LuaStatic.addGameObject2Lua(L, (UnityEngine.Component)item, "Component");
                    LuaDLL.lua_pushnumber(L, (double)(++num2));
                    LuaDLL.lua_insert(L, -2);
                    LuaDLL.lua_settable(L, -3);
                }

                return(result);
            }
            LuaStatic.traceback(L, "count not enough");
            LuaDLL.lua_error(L);
            return(result);
        }