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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…