docs.unity3d.com
    Show / Hide Table of Contents

    Class BindableEnum<T>

    Class which contains an enum member variable of type T and provides a binding API to data changes.

    Inheritance
    Object
    BindableVariableBase<T>
    BindableEnum<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 BindableEnum<T> : BindableVariableBase<T>, IReadOnlyBindableVariable<T> where T : struct, IConvertible
    Type Parameters
    Name Description
    T

    The type of the variable enum.

    Remarks

    Uses GetHashCode for comparison since Equals on an enum causes GC alloc.

    Constructors

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

    Declaration
    public BindableEnum(T initialValue = default(T), 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)

    Performs equal operation by comparing hash codes.

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

    Other enum to compare with.

    Returns
    Type Description
    Boolean

    Returns true if equal, returns false otherwise.

    Overrides
    Unity.XR.CoreUtils.Bindings.Variables.BindableVariableBase<T>.ValueEquals(T)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023