mercredi 8 avril 2015

Get types used inside a specific class

Here's the class, which I want to get a list of all types used in it:



public class TestClass : MonoBehaviour{
private UIManager _manager;

private void Initialize(UIManager manager){
_manager = manager;
}
}


Then I thought that by running something like this:



Assembly assembly = typeof (TestClass).Assembly;
foreach (Type type in assembly.GetTypes()){
Debug.Log(type.FullName);
}


Would give me just the UIManager type. But instead it seems like it's giving me the list of all types used on my project.


How can I get just the types used on this class?


(as you can see TestClass inherits from MonoBehaviour, but I don't want the types used there, I want the types used specifically in TestClass).






Aucun commentaire:

Enregistrer un commentaire