docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Constructor BindableVariableBase

    BindableVariableBase(T, bool, Func<T, T, bool>, bool)

    Constructor for bindable variable, which is a variable that notifies listeners when the internal value changes.

    Declaration
    protected BindableVariableBase(T initialValue = default, bool checkEquality = true, Func<T, T, bool> equalityMethod = null, bool startInitialized = false)
    Parameters
    Type Name Description
    T initialValue

    Value to initialize variable with. Defaults to type default.

    bool checkEquality

    Setting true checks whether to compare new value to old before triggering callback. Defaults to true.

    Func<T, T, bool> equalityMethod

    Func used to provide custom equality checking behavior. Defaults to Equals check.

    bool startInitialized

    Setting false results in initial value setting will trigger registered callbacks, regardless of whether the value is the same as the initial one. Defaults to false.

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