Unity get component type. So the returned class could be a MeshRenderer .