docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method LoadFromFileAsync

    LoadFromFileAsync<T>(string, Action<T>, int)

    Loads JSON data from a file asynchronously as a coroutine.

    Declaration
    public static IEnumerator LoadFromFileAsync<T>(string filePath, Action<T> onComplete, int bytesPerStep = 1048576)
    Parameters
    Type Name Description
    string filePath

    Path to the file to read.

    Action<T> onComplete

    Callback invoked with the deserialized data.

    int bytesPerStep

    Maximum characters read per frame.

    Returns
    Type Description
    IEnumerator

    An enumerator for coroutine execution.

    Type Parameters
    Name Description
    T

    Type to deserialize.

    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)