// Token: 0x06000111 RID: 273 RVA: 0x00009754 File Offset: 0x00007B54 public static void SaveImage(Texture2D texture, string fileName, string category, string fileType = "png") { string str = fileName + "_" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); ScreenshotManager.Instance.Awake(); string text; if (fileType == "png") { byte[] array = texture.EncodeToPNG(); text = ".png"; } else { byte[] array = texture.EncodeToJPG(); text = ".jpg"; } DirectoryInfo directoryInfo = new DirectoryInfo(Application.persistentDataPath + "/MyWork"); try { directoryInfo.GetFiles(); } catch { MonoBehaviour.print("Directry Catch SucessFully Created"); directoryInfo.Create(); } string text2 = Application.persistentDataPath + "/MyWork/" + str + text; Debug.LogWarning("Image Saved To Path =" + text2); ScreenshotManager.SaveTextureToFile(text2, texture); ScreenshotManager.DeleteTempImage(fileName + "temp" + text); }
// Token: 0x06000112 RID: 274 RVA: 0x00009840 File Offset: 0x00007C40 public static void SaveTempImageInspiration(Texture2D texture, string fileName, string fileType = "png") { fileName = fileName.Replace(" ", string.Empty); ScreenshotManager.Instance.Awake(); string str; if (fileType == "png") { byte[] array = texture.EncodeToPNG(); str = ".png"; } else { byte[] array = texture.EncodeToJPG(); str = ".jpg"; } DirectoryInfo directoryInfo = new DirectoryInfo(Application.persistentDataPath + "/InspirationTemp"); try { directoryInfo.GetFiles(); } catch { MonoBehaviour.print("Directry SucessFully Created"); directoryInfo.Create(); } string text = Application.persistentDataPath + "/InspirationTemp/" + fileName + str; Debug.LogWarning("Inspiration Saved To Path =" + text); ScreenshotManager.SaveTextureToFile(text, texture); }
// Token: 0x06000110 RID: 272 RVA: 0x000096BC File Offset: 0x00007ABC public static void SaveAssets(Texture2D texture, string fileName, string filePath, string fileType = "png") { ScreenshotManager.Instance.Awake(); filePath += "/Assets"; string str; if (fileType.ToLower().Contains("png")) { str = ".png"; } else { str = ".jpg"; } DirectoryInfo directoryInfo = new DirectoryInfo(filePath); try { directoryInfo.GetFiles(); } catch { MonoBehaviour.print("Directry SucessFully Created"); directoryInfo.Create(); } string path = filePath + "/" + fileName + str; ScreenshotManager.SaveTextureToFile(path, texture); }
// Token: 0x06000113 RID: 275 RVA: 0x00009908 File Offset: 0x00007D08 public static void SaveImageGallery(Texture2D texture, string fileName, string fileType = "png") { string text = fileName + "_" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); text.Replace(" ", string.Empty); ScreenshotManager.Instance.Awake(); byte[] bytes; string text2; if (fileType == "png") { bytes = texture.EncodeToPNG(); text2 = ".png"; } else { bytes = texture.EncodeToJPG(); text2 = ".jpg"; } string text3 = Application.productName.Replace(" ", string.Empty).ToLower(); DirectoryInfo directoryInfo = new DirectoryInfo(Application.persistentDataPath + "/" + text3); try { directoryInfo.GetFiles(); } catch { MonoBehaviour.print("Directry Catch SucessFully Created"); directoryInfo.Create(); } string text4 = string.Concat(new string[] { Application.persistentDataPath, "/", text3, "/", text, text2 }); Debug.LogWarning("Image Saved To Path =" + text4); ScreenshotManager.SaveTextureToFile(text4, texture); ScreenshotManager.Instance.StartCoroutine(ScreenshotManager.Instance.Save(bytes, text, text4, ScreenshotManager.ImageType.IMAGE)); }
// Token: 0x06000114 RID: 276 RVA: 0x00009A4C File Offset: 0x00007E4C public static void SaveTempImage(Texture2D texture, string fileName, string fileType = "jpg") { fileName = fileName.Replace(" ", string.Empty); ScreenshotManager.Instance.Awake(); string text; if (fileType == "png") { byte[] array = texture.EncodeToPNG(); text = ".png"; } else { byte[] array = texture.EncodeToJPG(); text = ".jpg"; } DirectoryInfo directoryInfo = new DirectoryInfo(Application.persistentDataPath + "/Temp"); try { directoryInfo.GetFiles(); } catch { MonoBehaviour.print("Directry SucessFully Created"); directoryInfo.Create(); } string path = string.Concat(new string[] { Application.persistentDataPath, "/Temp/", fileName, "temp", text }); ScreenshotManager.SaveTextureToFile(path, texture); PaintingScript.textureSaving = false; }