- Home /
Question by
brzydal · May 18, 2014 at 09:11 PM ·
c#classreflectionassembly
Reflection on Unity class
Hi, I am working on developer tool, I would like to call method from console in runtime like this: className.methodName param_1 param_2 For now it works, but it only can found method in my class, if I try find Unity class (for instance Application.LoadLevel()) it returns null. The code is:
Type CheckInAllAssemblies(string typeName)
{
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
Type type = null;
foreach(var a in assemblies)
{
type = a.GetType(typeName);
if(type != null)
return type;
}
return null;
}
I also have found that this would return null as well:
Type type = typeof(Debug).Assembly.GetType("Debug");
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
il2cpp generics and overloads 0 Answers
C# yield not doing anything 2 Answers
How can I access a function without knowing the script/class name to which it belongs? 1 Answer