private static TestityBaseInvokableCall GetObjectCall(UnityEngine.Object target, MethodInfo method, TestityArgumentCache arguments) { Type type = typeof(UnityEngine.Object); if (!string.IsNullOrEmpty(arguments.unityObjectArgumentAssemblyTypeName)) { type = Type.GetType(arguments.unityObjectArgumentAssemblyTypeName, false) ?? typeof(UnityEngine.Object); //Debug.Log("Calling on Type: " + type.FullName + " method name " + method.Name); } Type type1 = typeof(TestityCachedInvokableCall<>).MakeGenericType(new Type[] { type }); ConstructorInfo constructor = type1.GetConstructor(new Type[] { typeof(UnityEngine.Object), typeof(MethodInfo), type }); UnityEngine.Object obj = arguments.unityObjectArgument; if (obj != null && !type.IsAssignableFrom(obj.GetType())) { obj = null; } return constructor.Invoke(new object[] { target, method, obj }) as TestityBaseInvokableCall; }
private static TestityBaseInvokableCall GetObjectCall(UnityEngine.Object target, MethodInfo method, TestityArgumentCache arguments) { Type type = typeof(UnityEngine.Object); if (!string.IsNullOrEmpty(arguments.unityObjectArgumentAssemblyTypeName)) { type = Type.GetType(arguments.unityObjectArgumentAssemblyTypeName, false) ?? typeof(UnityEngine.Object); //Debug.Log("Calling on Type: " + type.FullName + " method name " + method.Name); } Type type1 = typeof(TestityCachedInvokableCall <>).MakeGenericType(new Type[] { type }); ConstructorInfo constructor = type1.GetConstructor(new Type[] { typeof(UnityEngine.Object), typeof(MethodInfo), type }); UnityEngine.Object obj = arguments.unityObjectArgument; if (obj != null && !type.IsAssignableFrom(obj.GetType())) { obj = null; } return(constructor.Invoke(new object[] { target, method, obj }) as TestityBaseInvokableCall); }