docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SaveToFileAsync

    SaveToFileAsync(string, string, Action<bool>, int)

    Saves text to a file asynchronously as a coroutine.

    Declaration
    public static IEnumerator SaveToFileAsync(string serializedData, string filePath, Action<bool> onComplete = null, int bytesPerStep = 1048576)
    Parameters
    Type Name Description
    string serializedData

    Text to write.

    string filePath

    Path to the file to write.

    Action<bool> onComplete

    Callback invoked with success state.

    int bytesPerStep

    Maximum characters written per frame.

    Returns
    Type Description
    IEnumerator

    An enumerator for coroutine execution.

    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)