Reduces the code:
var colliderGameObject = GetComponentInChildren<Collider>().gameObject;
var originalLayer = colliderGameObject.layer;
colliderGameObject.layer = 2; // IgnoreRaycast Layer (note: Physics.IgnoreRaycastLayer is actually 1 << 2 (the layermask instead of the layer itself))
// do the actual physics stuff:
var colliders = Physics.OverlapSphere(transform.position, 1, SomeLayerMask);
// ... do smth with colliders
colliderGameObject.layer = originalLayer;
to this:
using (new PhysicsDisposable(this.gameObject)) {
colliders = Physics.OverlapSphere(transform.position, 1, SomeLayerMask);
// ... do smth with colliders
}