Unified wall-resolved and wall-modeled method for large-eddy simulations of compressible wall-bounded flows