docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetData

    GetData<T>(string, T, bool)

    Get data via a specified key.

    Declaration
    public T GetData<T>(string key, T defaultValue, bool addDefault = false)
    Parameters
    Type Name Description
    string key

    The key.

    T defaultValue

    The default value to return if the data is not found.

    bool addDefault

    Optional parameter to control whether to add the default value if the data is not found.

    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    The data type.

    In This Article
    Back to top
    Copyright © 2025 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)