docs.unity.cn
    Show / Hide Table of Contents

    Class BindableVariableAlloc<T>

    Generic class which contains a member variable of type T and provides a binding API to data changes. If T is IEquatable, use BindableVariable<T> instead.

    Inheritance
    Object
    BindableVariableBase<T>
    BindableVariableAlloc<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)
    BindableVariableBase<T>.ValueEquals(T)
    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 BindableVariableAlloc<T> : BindableVariableBase<T>, IReadOnlyBindableVariable<T>
    Type Parameters
    Name Description
    T

    The type of the variable value.

    Remarks

    This class can be used for types which are not IEquatable. Since T is not IEquatable, when setting the value, it calls object.Equals and will GC alloc.

    Constructors

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

    Declaration
    public BindableVariableAlloc(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

    See Also

    BindableVariable<T>
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Tuesday, July 18, 2023