Set a variable to a collider type.

I’m trying to set a variable to a collider type.

When a particle hits an enemy I want it to see what type of collider it has just hit, box, capsule or sphere .

I thought something like this would work

private var col : Collider;
private var colCenter : Vector3;

col = _enemy*.Transforms.gameObject.GetComponent.<Collider>();*

var colType = col.GetType();
colCenter = _enemy*.Transforms.position + colType.center;*
But I get the error … ‘center’ is not a member of ‘System.Type’
Also tried
private var colCenter : Vector3;

var col = enemy*.Transforms.gameObject.GetComponent.().GetType();
colCenter = _enemy.Transforms.position + col.center;*

But still get the error … ‘centre’ is not a member of ‘System.Type’
Any help please, thanks._

How about something like this:

if(center is BoxCollider)
{
    BoxCollider box = (BoxCollider)center;
    // do code with box
}
else if(center is SphereCollider)
{
    ...
}
else ...