Kaihyo
Kaihyo
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
That was the issue, i was missing the instance. Thanks for the help 🙂
22 replies
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
And I think that's what I was missing
22 replies
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
Yes
22 replies
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
But thanks to you I know that it's a unity issue now and apparently the method needs to be a static method
22 replies
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
It's not like a game which I could decide if it's il2cpp or mono unfortunately 😦
22 replies
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
Well, since it's code to modify the editor behaviour, I'll suppose it depends on what unity is running on
22 replies
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
That's bothersome
22 replies
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
I suspected it could be linked to this
22 replies
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
Yes, it's within unity for editor code
22 replies
CC#
Created by Kaihyo on 10/23/2023 in #help
❔ Building a delegate with a Type and a MethodInfo keeps throwing ArgumentException
I didn't make the method generic because I won't know the element type in every scenario. But here is the full exception
ArgumentException: method arguments are incompatible
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) (at <cbc72d4a9767498db39486e941a498e3>:0)
System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure) (at <cbc72d4a9767498db39486e941a498e3>:0)
System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method) (at <cbc72d4a9767498db39486e941a498e3>:0)
System.Reflection.RuntimeMethodInfo.CreateDelegate (System.Type delegateType) (at <cbc72d4a9767498db39486e941a498e3>:0)
ArgumentException: method arguments are incompatible
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure, System.Boolean allowClosed) (at <cbc72d4a9767498db39486e941a498e3>:0)
System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method, System.Boolean throwOnBindFailure) (at <cbc72d4a9767498db39486e941a498e3>:0)
System.Delegate.CreateDelegate (System.Type type, System.Reflection.MethodInfo method) (at <cbc72d4a9767498db39486e941a498e3>:0)
System.Reflection.RuntimeMethodInfo.CreateDelegate (System.Type delegateType) (at <cbc72d4a9767498db39486e941a498e3>:0)
22 replies