I have a foreach loop running on a list of types. Passing in a variable of type Type as a Type fails outright. Based on similar questions seen on this site, I wrote up a reflection-powered solution but this fails at runtime. I do not know how to proceed from this point.
foreach (Type defType in GenDefDatabase.AllDefTypesWithDatabases())
{
// Compile Error: 'defType' is a variable but is used like a type
DefDatabase<defType>.ResolveAllReferences();
// Runtime Error: System.ArgumentException: The method has 0 generic parameter(s) but 1 generic argument(s) were provided.
// at System.Reflection.MonoMethod.MakeGenericMethod (System.Type[] methodInstantiation) [0x00000] in <filename unknown>:0
typeof(DefDatabase<>).GetMethod("ResolveAllReferences", BindingFlags.Public | BindingFlags.Static).MakeGenericMethod(defType).Invoke(null, null);
}