Add the two scripts to your project. Put the ExtractRenderTextureEditor.cs script in a folder called "Editor". Then add the ExtractRenderTexture.cs script to a Camera (or an empty game object). Done.
Open the Cube_Mipmap scene. To adjust the mipmap level in the editor, click on the cube, expand the shader properties, and change the Mip Level value. To adjust the mipmap level at runtime, open the ...