docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Constructor BindableEnum

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

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

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

    Enum value of type T to initialize enum with. Defaults to type default.

    bool checkEquality

    Setting true checks whether to compare new enum 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 enum 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)