I am currently using:
public static Type FindType(string qualifiedTypeName)
{
Type t = Type.GetType(qualifiedTypeName);
if (t != null)
{
return t;
}
else
{
foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
{
t = asm.GetType(qualifiedTypeName);
if (t != null)
return t;
}
return null;
}
kudos to @Alistar from this post : Type.GetType not working
However, even this doesnt work when it comes to a list of Vector3s from UnityEngine.
I know that you can include the relevant assembly also by adding ", UnityEngine" at the end, but it doesnt work.
Edit:
Just to clarify, I am trying to use a string value
"System.Collections.Generic.List`1[UnityEngine.Vector3]"
Where the actual list type could be anything, and would like to find the actual Type from this string. This works with regular lists and regular vars, but I get null result when it comes to special list types.
Any ideas?
The string you provide is not an
AssemblyQualifiedName!It rather looks like it is only the result of
Type.ToString.e.g. the
AssemblyQualifiedNameof aList<string>looks like this:and of a
List<Vector3>it would be