GetUniquePathForName() private static method

private static GetUniquePathForName ( string name ) : string
name string
return string
コード例 #1
0
        public static void ScreenGameViewContent()
        {
            string uniquePathForName = ScreenShots.GetUniquePathForName("ContentExample");

            Application.CaptureScreenshot(uniquePathForName);
            Debug.Log(string.Format("Saved screenshot at {0}", uniquePathForName));
        }
コード例 #2
0
        private static string SaveScreenShot(int width, int height, Color[] pixels, string name)
        {
            Texture2D texture2D = new Texture2D(width, height);

            texture2D.SetPixels(pixels, 0);
            texture2D.Apply(true);
            byte[] bytes = texture2D.EncodeToPNG();
            UnityEngine.Object.DestroyImmediate(texture2D, true);
            string uniquePathForName = ScreenShots.GetUniquePathForName(name);

            File.WriteAllBytes(uniquePathForName, bytes);
            Debug.Log(string.Format("Saved screenshot at {0}", uniquePathForName));
            return(uniquePathForName);
        }