This question already has an answer here:
- Avoiding an ambiguous match exception 2 answers
My class has two methods that look like this:
void Update()
void Update(string)
With reflection, I want to call the top one, but when I try this:
const BindingFlags findFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
var methodInfo = script.GetType().GetMethod(methodName, findFlags);
I get a AmbiguousMatchException
. How do I call the no arg method?
Aucun commentaire:
Enregistrer un commentaire