UnityEngine.AndroidReflection.GetMethodMember C# (CSharp) Method

GetMethodMember() public static method

public static GetMethodMember ( IntPtr jclass, string methodName, string signature, bool isStatic ) : IntPtr
jclass System.IntPtr
methodName string
signature string
isStatic bool
return System.IntPtr
        public static IntPtr GetMethodMember(IntPtr jclass, string methodName, string signature, bool isStatic)
        {
            IntPtr ptr;
            jvalue[] args = new jvalue[4];
            try
            {
                args[0].l = jclass;
                args[1].l = AndroidJNISafe.NewStringUTF(methodName);
                args[2].l = AndroidJNISafe.NewStringUTF(signature);
                args[3].z = isStatic;
                ptr = AndroidJNISafe.CallStaticObjectMethod(s_ReflectionHelperClass, s_ReflectionHelperGetMethodID, args);
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(args[1].l);
                AndroidJNISafe.DeleteLocalRef(args[2].l);
            }
            return ptr;
        }

Usage Example

コード例 #1
0
        public static IntPtr GetMethodID(IntPtr jclass, string methodName, string signature, bool isStatic)
        {
            IntPtr intPtr = IntPtr.Zero;
            IntPtr result;

            try
            {
                intPtr = AndroidReflection.GetMethodMember(jclass, methodName, signature, isStatic);
                result = AndroidJNISafe.FromReflectedMethod(intPtr);
            }
            catch (Exception ex)
            {
                IntPtr methodIDFallback = _AndroidJNIHelper.GetMethodIDFallback(jclass, methodName, signature, isStatic);
                if (!(methodIDFallback != IntPtr.Zero))
                {
                    throw ex;
                }
                result = methodIDFallback;
            }
            finally
            {
                AndroidJNISafe.DeleteLocalRef(intPtr);
            }
            return(result);
        }
All Usage Examples Of UnityEngine.AndroidReflection::GetMethodMember