Files, Paths, Names and IO common methods. (Last update: 2019-10-19).. *** Reminder! File IO methods do not work with streamingAssetsPath on Android.
More...
|
string | GetAppPath (AppPath appPath) |
|
string | GetSaveDirectory (bool isTemporaryPath=false, string subFolder="", bool createDirectoryIfNotExist=false) |
|
string | GetFileNameWithoutExt (bool millisecond=false) |
|
string | GenerateFileNameWithDateTimeParameters (int YYYY, int MM, int DD, int hh=0, int mm=0, int ss=0, int fff=-1) |
|
int | CompareFileNameWithTime (string fileName_FPN, DateTime dateTime) |
| Compare the filename (generated by FilePathName class) with the provided DateTime. Return -1, 0, 1. (-1: fileName time is earlier; 0: equals; 1 fileName time is later)
|
|
bool | CheckFileNameWithinDateTimeInterval (string fileName_FPN, DateTime startDateTime, DateTime endDateTime) |
| Check if the filename (generated by FilePathName class) within the Start and End DateTime interval.
|
|
string | EnsureValidPath (string pathOrUrl) |
|
string | EnsureLocalPath (string path) |
|
String | EnsureValidFileName (String fileName) |
|
string | GetGifFileName () |
|
string | GetGifFullPath (string subFolder="", bool createDirectoryIfNotExist=false) |
|
string | GetDownloadedGifSaveFullPath (string subFolder="", bool createDirectoryIfNotExist=false) |
|
string | GetJpgFileName () |
|
string | GetJpgFullPath (string subFolder="", bool createDirectoryIfNotExist=false) |
|
string | GetPngFileName () |
|
string | GetPngFullPath (string subFolder="", bool createDirectoryIfNotExist=false) |
|
byte[] | ReadFileToBytes (string fromFullPath) |
|
void | WriteBytesToFile (string toFullPath, byte[] byteArray) |
|
void | CopyFile (string fromFullPath, string toFullPath, bool overwrite=false) |
|
void | MoveFile (string fromFullPath, string toFullPath) |
|
void | DeleteFile (string fileFullPath) |
|
void | CheckToCreateDirectory (string directory) |
|
bool | PathIsDirectory (string path) |
| Determine whether a given path is a directory.
|
|
void | RenameFile (string originFilePath, string newFileName) |
|
bool | FileStreamTo (string fileFullpath, byte[] byteArray) |
|
void | WriteBytesToText (byte[] bytes, string toFileFullPath, string separator="", bool toChar=true) |
|
string | SaveImage (Texture2D texture, string subFolder, string fileName, SaveFormat imageFormat, Environment.SpecialFolder specialFolder=Environment.SpecialFolder.MyPictures, int jpgQuality=90) |
| Saves texture as JPG/PNG on Windows/Mac.
|
|
string | SaveBytes (byte[] bytes, string subFolder, string fileNameWithExtension, Environment.SpecialFolder specialFolder=Environment.SpecialFolder.MyPictures) |
| Saves file byte array on Windows/Mac.
|
|
string | SaveTextureAs (Texture2D texture2D, SaveFormat format=SaveFormat.JPG) |
|
string | SaveTextureAs (Texture2D texture2D, AppPath appPath, string subFolder, bool isJPG) |
|
Texture2D | LoadImage (string fullFilePath) |
|
List< Texture2D > | LoadImages (string directory, List< string > fileExtensions=null) |
| Load images in the target directory, to a texture2D list.
|
|
List< byte[]> | LoadFiles (string directory, List< string > fileExtensions=null) |
| Load files in the target directory, to a byte[] list.
|
|
List< string > | GetFilePaths (string directory, List< string > fileExtensions=null) |
| Get file paths in the target directory.
|
|
IEnumerator | LoadFileWWW (string url, Action< byte[]> onLoadCompleted=null, Action< WWW > onLoadCompletedWWW=null) |
| Loads file using WWW. Return the byte array of the file in onLoadCompleted callback. ( IEnumerator: Remember to call this method in StartCoroutine )
|
|
Sprite | Texture2DToSprite (Texture2D texture2D) |
|
Files, Paths, Names and IO common methods. (Last update: 2019-10-19).. *** Reminder! File IO methods do not work with streamingAssetsPath on Android.