private static bool CheckArgumentTypes(Type[] types, MethodInfo method)
{
ParameterInfo[] parameters = method.GetParameters();
if (types.Length != parameters.Length)
{
string[] textArray1 = new string[] { "Parameter count did not match. Expected: ", types.Length.ToString(), " Got: ", parameters.Length.ToString(), " in ", method.DeclaringType.ToString(), ".", method.Name };
Debug.LogWarning(string.Concat(textArray1));
return false;
}
int index = 0;
foreach (Type type in types)
{
ParameterInfo info = parameters[index];
if (type != info.ParameterType)
{
Debug.LogWarning(string.Concat(new object[] { "Parameter type mismatch at parameter ", index, ". Expected: ", type.ToString(), " Got: ", info.ParameterType.ToString(), " in ", method.DeclaringType.ToString(), ".", method.Name }));
return false;
}
index++;
}
return true;
}