xxxxxxxxxx
Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false);
// ofc you probably don't have a class that is called CameraController :P
Camera activeCamera = CameraController.getActiveCamera();
// Initialize and render
RenderTexture rt = new RenderTexture(width, height, 24);
activeCamera.targetTexture = rt;
activeCamera.Render();
RenderTexture.active = rt;
// Read pixels
tex.ReadPixels(rectReadPicture, 0, 0);
// Clean up
activeCamera.targetTexture = null;
RenderTexture.active = null; // added to avoid errors
DestroyImmediate(rt);