Is there a way to specify a type in runtime through casting a string with the types name? I hop my non-compiling code below can explain what i am trying to do. Let me know otherwise and ill try to explain it better.
var valueFromDropDownMenu = "MyClass";
List<Type.GetType(valueFromDropDownMenu)> dynamicList =
new List<Type.GetType(valueFromDropDownMenu) > ();
// Code to iterate through objects and populate dynamicList
// with all objects of correct type
What I am trying to do is to let the user choose what type of object I will process.
I am Using Unity3D which is a game dev framework and it uses a static method to load resources from files. These resources needs to be cast.
I'm trying to make a developer tool that lets the developer choose a specific type of resources to be loaded. So i need to do something like
var files = LoadAll("Path, ofType(UserSelectedType));
Is it possible?