Is it possible to use a variable as a Type?

For instance:

Type myType = new Type //initialize somehow? I can’t initialize System.Type as it is an abstract

//make changes to myType

myGameObject.GetComponent *< myType *>();

If this is possible, could you also then please demonstrate how to pass this to a function?

Many thanks

You looking for something like this?

public Component getCustomComponent(string comp)
{
    Type myType = Type.GetType(comp); 
    return myGameObject.GetComponent(myType);
}

getCustomComponent("MyCustomComponent");