My Project
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Properties | List of all members
SDev.FileSaveUtil Class Reference

Save byte array, Texture2D to file on current platform's Application data path or Windows/Mac special folder. More...

Public Types

enum  AppPath { PersistentDataPath = 0 , TemporaryCachePath , StreamingAssetsPath , DataPath }
 

Public Member Functions

string GetAppPath (AppPath appPath)
 
string SaveTextureAsEXR (Texture2D texture2D, string directory, string fileNameWithoutExtension, Texture2D.EXRFlags exrFlags=Texture2D.EXRFlags.None)
 Saves Texture2D as EXR to accessible path (e.g. Application data path).
 
string SaveTextureAsEXR (Texture2D texture2D, AppPath appPath, string subFolderName, string fileNameWithoutExtension, Texture2D.EXRFlags exrFlags=Texture2D.EXRFlags.None)
 Saves Texture2D as JPG to Application data path.
 
string SaveTextureAsEXR (Texture2D texture2D, Environment.SpecialFolder specialFolder, string subFolderName, string fileNameWithoutExtension, Texture2D.EXRFlags exrFlags=Texture2D.EXRFlags.None)
 Saves Texture2D as JPG to Windows/Mac special folder.
 
string SaveTextureAsJPG (Texture2D texture2D, string directory, string fileNameWithoutExtension, int quality=90)
 Saves Texture2D as JPG to accessible path (e.g. Application data path).
 
string SaveTextureAsJPG (Texture2D texture2D, AppPath appPath, string subFolderName, string fileNameWithoutExtension, int quality=90)
 Saves Texture2D as JPG to Application data path.
 
string SaveTextureAsJPG (Texture2D texture2D, Environment.SpecialFolder specialFolder, string subFolderName, string fileNameWithoutExtension, int quality=90)
 Saves Texture2D as JPG to Windows/Mac special folder.
 
string SaveTextureAsPNG (Texture2D texture2D, string directory, string fileNameWithoutExtension)
 Saves Texture2D as PNG to accessible path (e.g. Application data path).
 
string SaveTextureAsPNG (Texture2D texture2D, AppPath appPath, string subFolderName, string fileNameWithoutExtension)
 Saves Texture2D as PNG to Application data path.
 
string SaveTextureAsPNG (Texture2D texture2D, Environment.SpecialFolder specialFolder, string subFolderName, string fileNameWithoutExtension)
 Saves Texture2D as PNG to Windows/Mac special folder.
 
string SaveBytes (byte[] bytes, string directory, string fileNameWithExtension)
 Saves file byte array to accessible path (e.g. Application data path).
 
string SaveBytes (byte[] bytes, AppPath appPath, string subFolderName, string fileNameWithExtension)
 Saves file byte array to Application data path.
 
string SaveBytes (byte[] bytes, Environment.SpecialFolder specialFolder, string subFolderName, string fileNameWithExtension)
 Saves file byte array to Windows/Mac special folder.
 
string SaveBytes (byte[] bytes, Environment.SpecialFolder specialFolder, string fileNameWithExtension)
 Saves file byte array to Windows/Mac special folder.
 

Properties

static FileSaveUtil Instance [get]
 

Detailed Description

Save byte array, Texture2D to file on current platform's Application data path or Windows/Mac special folder.

Member Enumeration Documentation

◆ AppPath

Enumerator
PersistentDataPath 

The directory path where you can store data that you want to be kept between runs.

TemporaryCachePath 

The directory path where temporary data can be stored.

StreamingAssetsPath 

The folder located at /Assets/StreamingAssets in the project. (Not work with System.IO methods when running on Android/WebGL)

DataPath 

The folder located at /Assets in the project. (Work on the Unity editor only)


The documentation for this class was generated from the following file: