UnityEditor.ScreenShots.GetUniquePathForName C# (CSharp) Méthode

GetUniquePathForName() private static méthode

private static GetUniquePathForName ( string name ) : string
name string
Résultat 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;
        }

Usage Example

        public static void ScreenGameViewContent()
        {
            string uniquePathForName = ScreenShots.GetUniquePathForName("ContentExample");

            Application.CaptureScreenshot(uniquePathForName);
            Debug.Log(string.Format("Saved screenshot at {0}", uniquePathForName));
        }
All Usage Examples Of UnityEditor.ScreenShots::GetUniquePathForName