private static GetUniquePathForName ( string name ) : string | ||
name | string | |
리턴 | string |
private static string GetUniquePathForName(string name)
{
string path = string.Format("{0}/../../{1}.png", Application.dataPath, name);
for (int i = 0; File.Exists(path); i++)
{
path = string.Format("{0}/../../{1}{2:000}.png", Application.dataPath, name, i);
}
return path;
}
public static void ScreenGameViewContent() { string uniquePathForName = ScreenShots.GetUniquePathForName("ContentExample"); Application.CaptureScreenshot(uniquePathForName); Debug.Log(string.Format("Saved screenshot at {0}", uniquePathForName)); }