private void Update()
{
if (Input.GetKeyDown("f9"))
{
string screenshotFilename;
do
{
++_screenshotCount;
screenshotFilename = Application.persistentDataPath + "/screenshot" + _screenshotCount + ".png";
} while (System.IO.File.Exists(screenshotFilename));
Application.CaptureScreenshot(screenshotFilename);
PSDebug.Log("SCREENSHOT {0}", screenshotFilename);
}
}