public MethodWrap _GenMethodWrap(Type type, string methodName, IEnumerable <MemberInfo> methodBases, bool forceCheck = false)
        {
            List <OverloadMethodWrap> overloads = new List <OverloadMethodWrap>();

            foreach (var methodBase in methodBases)
            {
                var mb = methodBase as MethodBase;
                if (mb == null)
                {
                    continue;
                }

                if (mb.IsGenericMethodDefinition
#if !ENABLE_IL2CPP
                    && !tryMakeGenericMethod(ref mb)
#endif
                    )
                {
                    continue;
                }

                var overload = new OverloadMethodWrap(translator, type, mb);
                overload.Init(objCheckers, objCasters);
                overloads.Add(overload);
            }
            return(new MethodWrap(methodName, overloads, forceCheck));
        }
        public MethodWrap _GenMethodWrap(Type type, string methodName, IEnumerable <MemberInfo> methodBases)
        {
            List <OverloadMethodWrap> overloads = new List <OverloadMethodWrap>();

            foreach (var methodBase in methodBases)
            {
                if (methodBase is MethodBase && !(methodBase as MethodBase).ContainsGenericParameters)
                {
                    var overload = new OverloadMethodWrap(translator, type, methodBase as MethodBase);
                    overload.Init(objCheckers, objCasters);
                    overloads.Add(overload);
                }
            }
            return(new MethodWrap(methodName, overloads));
        }
Beispiel #3
0
        public MethodWrap _GenMethodWrap(Type type, string methodName, IEnumerable <MemberInfo> methodBases)
        {
            List <OverloadMethodWrap> overloads = new List <OverloadMethodWrap>();

            foreach (var methodBase in methodBases)
            {
                var mb = methodBase as MethodBase;
                if (mb == null)
                {
                    continue;
                }

                if (mb.ContainsGenericParameters && !tryMakeGenericMethod(ref mb))
                {
                    continue;
                }

                var overload = new OverloadMethodWrap(translator, type, mb);
                overload.Init(objCheckers, objCasters);
                overloads.Add(overload);
            }
            return(new MethodWrap(methodName, overloads));
        }
        static int _m_Init(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    XLua.ObjectCheckers _objCheckers = (XLua.ObjectCheckers)translator.GetObject(L, 2, typeof(XLua.ObjectCheckers));
                    XLua.ObjectCasters  _objCasters  = (XLua.ObjectCasters)translator.GetObject(L, 3, typeof(XLua.ObjectCasters));

                    gen_to_be_invoked.Init(_objCheckers, _objCasters);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Beispiel #5
0
        public MethodWrap _GenMethodWrap(Type type, string methodName, IEnumerable<MemberInfo> methodBases)
        {
            List<OverloadMethodWrap> overloads = new List<OverloadMethodWrap>();
            foreach(var methodBase in methodBases)
            {
                var mb = methodBase as MethodBase;
                if (mb == null)
                    continue;

                if (mb.ContainsGenericParameters && !tryMakeGenericMethod(ref mb))
                    continue;

                var overload = new OverloadMethodWrap(translator, type, mb);
                overload.Init(objCheckers, objCasters);
                overloads.Add(overload);
            }
            return new MethodWrap(methodName, overloads);
        }