Im making a XNA contentloader:
public object[] LoadIt(KeyValuePair<Type,string>[] resources, ContentManager content)
{
object[] result = new object[resources.Length];
for(int i=0;i<result.Length;i++)
{
result[i] = content.Load<resources[i].Key>(resources[i].Value);
}
return result;
}
but apparenty you're not allowed to pass a generic type from a variable, so how do i solve this then?
also if you pass the type as a generic to the method itself, then i still need the object calling the method to get the type from variable, since ill be making a file that declares the files to load and from the strings of that file, i need to pass the type and path of the files to load