Class BindableVariable<T>
Generic class which contains a member variable of type T
and provides a binding API to data changes.
Inherited Members
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)