string to class

Is there a way to make class reference from string?
Like i’m making game where 1 script will reference to many other scripts and for making it easier i wanted to make class from string. If you don’t get what i’m saying here is script part that i don’t know how to do:

GetComponent<#>()…

# stands for class. but i want convert string so it would be easier to implement.

like when i’ll wrote

GetComponent<somestring>()...

it’s not taking somestring as var but class name

so it’s there way to make string be converted to class name?

You can do this

var myComponent = GetComponent("MyClass");

or this

Component myComponent = GetComponent("MyClass");

which is essentially the same thing but you will be limited to only the properties and functions of a Component class.

You would actually need to do something like this

MyClass other = GetComponent("MyClass") as MyClass;

to get the classes full functionality which basically nullifies what you are trying to accomplish.