Search Results for

    Show / Hide Table of Contents

    Class UnityFile

    C# 'File' equivalent for UnityEngine.Object types.

    Inheritance
    object
    UnityFile
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.IO.Files
    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
    Type Name Description
    string url
    AudioType audioType
    CancellationToken ct
    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
    Type Name Description
    string url
    CancellationToken ct
    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
    Type Description
    byte[]
    | Edit this page View Source

    GetSafeWriteDir(string)

    Declaration
    public static string GetSafeWriteDir(string path)
    Parameters
    Type Name Description
    string path
    Returns
    Type Description
    string
    | 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
    Type Name Description
    string path
    UnityPathType? pathType
    AudioType audioType
    CancellationToken ct
    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
    Type Name Description
    string fullPath
    string fallbackDownloadUrl
    AudioType audioType
    CancellationToken ct
    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
    Type Name Description
    string fullPath
    string fallbackDownloadUrl
    CancellationToken ct
    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
    Type Name Description
    string path
    UnityPathType pathType
    CancellationToken ct
    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 Description
    MimeType
    Type Parameters
    Name Description
    T
    | 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
    Name Description
    T
    | 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
    Type Name Description
    Object obj
    string path
    bool overwrite
    bool log
    Returns
    Type Description
    string
    | 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
    Type Description
    UniTask
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation