docs.unity.cn
    Show / Hide Table of Contents

    Class BindableVariable<T>

    Generic class which contains a member variable of type T and provides a binding API to data changes.

    Inheritance
    Object
    BindableVariableBase<T>
    BindableVariable<T>
    Inherited Members
    BindableVariableBase<T>.Value
    BindableVariableBase<T>.BindingCount
    BindableVariableBase<T>.SetValueWithoutNotify(T)
    BindableVariableBase<T>.Subscribe(Action<T>)
    BindableVariableBase<T>.SubscribeAndUpdate(Action<T>)
    BindableVariableBase<T>.Unsubscribe(Action<T>)
    BindableVariableBase<T>.BroadcastValue()
    BindableVariableBase<T>.Task(Func<T, Boolean>, CancellationToken)
    BindableVariableBase<T>.Task(T, CancellationToken)
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.XR.CoreUtils.Bindings.Variables
    Syntax
    public class BindableVariable<T> : BindableVariableBase<T>, IReadOnlyBindableVariable<T> where T : IEquatable<T>
    Type Parameters
    Name Description
    T

    The type of the variable value.

    Remarks

    T is IEquatable to avoid GC alloc that would occur with object.Equals in the base class.

    Constructors

    BindableVariable(T, Boolean, Func<T, T, Boolean>, Boolean)

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

    Methods

    ValueEquals(T)

    Evaluates equality with the internal value held by the bindable variable.

    Declaration
    public override bool ValueEquals(T other)
    Parameters
    Type Name Description
    T other

    Other value to compare equality against.

    Returns
    Type Description
    Boolean

    True if both values are equal.

    Overrides
    Unity.XR.CoreUtils.Bindings.Variables.BindableVariableBase<T>.ValueEquals(T)
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Thursday, May 4, 2023