void Fun(Camera m_Camera, string filePath)
{
RenderTexture rt = new RenderTexture(Screen.width, Screen.height, 16);
m_Camera.targetTexture = rt;
m_Camera.Render();
RenderTexture.active = rt;
Texture2D t = new Texture2D(Screen.width, Screen.height);
t.ReadPixels(new Rect(0, 0, t.width, t.height), 0, 0);
t.Apply();
System.IO.File.WriteAllBytes(filePath, t.EncodeToPNG());
}