Class UnityFile
C# 'File' equivalent for UnityEngine.Object types.
Assembly: Glitch9.IO.dll
Syntax
public static class UnityFile
Methods
|
Edit this page
View Source
DownloadAudioClipAsync(string, AudioType, CancellationToken)
Declaration
public static UniTask<AudioClip> DownloadAudioClipAsync(string url, AudioType audioType = AudioType.UNKNOWN, CancellationToken ct = default)
Parameters
Returns
| Type |
Description |
| UniTask<AudioClip> |
|
|
Edit this page
View Source
DownloadTexture2DAsync(string, CancellationToken)
Declaration
public static UniTask<Texture2D> DownloadTexture2DAsync(string url, CancellationToken ct = default)
Parameters
Returns
| Type |
Description |
| UniTask<Texture2D> |
|
|
Edit this page
View Source
EncodeToBytes(Object)
Declaration
public static byte[] EncodeToBytes(Object obj)
Parameters
| Type |
Name |
Description |
| Object |
obj |
|
Returns
|
Edit this page
View Source
GetSafeWriteDir(string)
Declaration
public static string GetSafeWriteDir(string path)
Parameters
| Type |
Name |
Description |
| string |
path |
|
Returns
|
Edit this page
View Source
ReadAudioClipAsync(string, UnityPathType?, AudioType, CancellationToken)
Declaration
public static UniTask<AudioClip> ReadAudioClipAsync(string path, UnityPathType? pathType = null, AudioType audioType = AudioType.UNKNOWN, CancellationToken ct = default)
Parameters
Returns
| Type |
Description |
| UniTask<AudioClip> |
|
|
Edit this page
View Source
ReadAudioClipAsync(string, AudioType)
Declaration
public static UniTask<AudioClip> ReadAudioClipAsync(string fullPath, AudioType audioType)
Parameters
| Type |
Name |
Description |
| string |
fullPath |
|
| AudioType |
audioType |
|
Returns
| Type |
Description |
| UniTask<AudioClip> |
|
|
Edit this page
View Source
ReadOrDownloadAudioClipAsync(string, string, AudioType, CancellationToken)
Declaration
public static UniTask<AudioClip> ReadOrDownloadAudioClipAsync(string fullPath, string fallbackDownloadUrl, AudioType audioType = AudioType.UNKNOWN, CancellationToken ct = default)
Parameters
Returns
| Type |
Description |
| UniTask<AudioClip> |
|
|
Edit this page
View Source
ReadOrDownloadTexture2DAsync(string, string, CancellationToken)
Declaration
public static UniTask<Texture2D> ReadOrDownloadTexture2DAsync(string fullPath, string fallbackDownloadUrl, CancellationToken ct = default)
Parameters
Returns
| Type |
Description |
| UniTask<Texture2D> |
|
|
Edit this page
View Source
ReadTexture2DAsync(string)
Declaration
public static UniTask<Texture2D> ReadTexture2DAsync(string fullPath)
Parameters
| Type |
Name |
Description |
| string |
fullPath |
|
Returns
| Type |
Description |
| UniTask<Texture2D> |
|
|
Edit this page
View Source
ReadTexture2DAsync(string, UnityPathType, CancellationToken)
Declaration
public static UniTask<Texture2D> ReadTexture2DAsync(string path, UnityPathType pathType = UnityPathType.Absolute, CancellationToken ct = default)
Parameters
Returns
| Type |
Description |
| UniTask<Texture2D> |
|
|
Edit this page
View Source
ResolveMimeType<T>(string)
Declaration
public static MimeType ResolveMimeType<T>(string fullPath = null) where T : Object
Parameters
| Type |
Name |
Description |
| string |
fullPath |
|
Returns
Type Parameters
|
Edit this page
View Source
ResourcesLoadAsync<T>(string)
Declaration
public static UniTask<T> ResourcesLoadAsync<T>(string resourcePath) where T : Object
Parameters
| Type |
Name |
Description |
| string |
resourcePath |
|
Returns
| Type |
Description |
| UniTask<T> |
|
Type Parameters
|
Edit this page
View Source
SafeWrite(Object, string, bool, bool)
Writes a UnityEngine.Object to a file even if the path is null or empty.
Declaration
public static string SafeWrite(Object obj, string path, bool overwrite = false, bool log = false)
Parameters
Returns
|
Edit this page
View Source
Write(Object, string, bool)
Declaration
public static void Write(Object obj, string fullPath, bool log = false)
Parameters
| Type |
Name |
Description |
| Object |
obj |
|
| string |
fullPath |
|
| bool |
log |
|
|
Edit this page
View Source
WriteAsync(Object, string, bool)
Declaration
public static UniTask WriteAsync(Object obj, string fullPath, bool log = false)
Parameters
| Type |
Name |
Description |
| Object |
obj |
|
| string |
fullPath |
|
| bool |
log |
|
Returns