Get resulting rectangle from two overlapping rectangles
float minX;
float maxX;
float minZ;
float maxZ;


The declarations can be inlined so that it is clearer when they are being set. However, in geometry and other applications it may be preferable to declare them like this.

if (a.max.x &lt; bounds.max.x)
            maxX = a.max.x;
        else
            maxX = bounds.max.x;


These conditions can be replaced with calls to Math.max and Math.min.

The variable names such as minX and maxX seem to be reversed; minX seems to be referring to maxX and vice-versa. I am not very familiar with geometry so I don't know if my suggestion is correct to swap the names.

After applying these suggestions, the method becomes the following:

  public static bool Overlaps(this Bounds a, Bounds bounds, out Bounds result)
    {
        result = new Bounds();
        //they don't overlap
        if (!a.Intersects(bounds)) return false;

        float minX = Math.Max(a.min.x, bounds.min.x);
        float maxX = Math.Min(a.max.x, bounds.max.x);

        float minZ = Math.Max(a.min.z, bounds.min.z);
        float maxZ = Math.Min(a.max.z, bounds.max.z);

        // using XZ plane for debug
        Vector3 min = new Vector3(minX, 0, minZ);
        Vector3 max = new Vector3(maxX, 0, maxZ);
        result.SetMinMax(min, max);
        return true;
    }


Edit: to respond to the comment (minimizing if statements), it could be expressed as:

  public static bool Overlaps(this Bounds a, Bounds bounds, out Bounds result)
    {
        result = new Bounds();

        float minX = Math.Max(a.min.x, bounds.min.x);
        float maxX = Math.Min(a.max.x, bounds.max.x);

        float minZ = Math.Max(a.min.z, bounds.min.z);
        float maxZ = Math.Min(a.max.z, bounds.max.z);

        // using XZ plane for debug
        Vector3 min = new Vector3(minX, 0, minZ);
        Vector3 max = new Vector3(maxX, 0, maxZ);
        result.SetMinMax(min, max);
        return !a.Intersects(bounds);
    }


This would be slightly less efficient; I don't know if this is valid as if the Vector3 class will accept input which did not pass .Intersects.