docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method WriteAndAddFile

    WriteAndAddFile(string, byte[])

    Writes binary content to path on disk and registers the path with this registry. Creates any intermediate directories as needed.

    Declaration
    public bool WriteAndAddFile(string path, byte[] content)
    Parameters
    Type Name Description
    string path

    Destination file path.

    byte[] content

    Binary content to write.

    Returns
    Type Description
    bool

    true on success; false if an exception was thrown (logged via UnityEngine.Debug).

    WriteAndAddFile(string, string)

    Writes text content to path on disk and registers the path with this registry. Creates any intermediate directories as needed.

    Declaration
    public bool WriteAndAddFile(string path, string content)
    Parameters
    Type Name Description
    string path

    Destination file path.

    string content

    Text content to write.

    Returns
    Type Description
    bool

    true on success; false if an exception was thrown (logged via UnityEngine.Debug).

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)