public void Detach()
{
if (attachMode.Docked) {
Detach(AttachType.Docked);
}
if (attachMode.Coupled) {
Detach(AttachType.Coupled);
}
if (attachMode.FixedJoint) {
Detach(AttachType.FixedJoint);
}
if (attachMode.StaticJoint) {
Detach(AttachType.StaticJoint);
}
}