Debology.Debby.Modules.Adjust
AdjustableValue<T> Class
A flexible adjustable value that can work with stored values or getter/setter functions. You should use this if you want to add controls to Adjust at runtime.
public class AdjustableValue<T> : Debology.Debby.Modules.Adjust.IAdjustableValue<T>, Debology.Debby.Modules.Adjust.IAdjustableValueBase, Debology.Debby.Modules.Adjust.IAdjustable, Debology.Debby.Modules.Adjust.ITrackableValueType parameters
T
The type of the value
Inheritance System.Object 🡒 UnityEngine.UIElements.INotifyValueChanged 🡒 AdjustableValue<T>
Implements Debology.Debby.Modules.Adjust.IAdjustableValue<T>, Debology.Debby.Modules.Adjust.IAdjustableValueBase, Debology.Debby.Modules.Adjust.IAdjustable, Debology.Debby.Modules.Adjust.ITrackableValue
Constructors
AdjustableValue(Func<T>, Action<T>) Constructor
Creates a new adjustable value.
public AdjustableValue(System.Func<T> getter, System.Action<T> setter=null);Parameters
getter System.Func<T>
Getter function to retrieve the current value
setter System.Action<T>
Optional setter function to update the value
Exceptions
System.ArgumentException
Thrown when setter is provided without getter
AdjustableValue(T) Constructor
Creates a new adjustable value.
public AdjustableValue(T initialValue);Parameters
initialValue T
Initial value
Exceptions
System.ArgumentException
Thrown when setter is provided without getter
Properties
AdjustableValue<T>.ReadOnly Property
Gets whether this value is read-only (only getter provided).
public bool ReadOnly { get; }Implements ReadOnly
Property Value
AdjustableValue<T>.value Property
Gets or sets the current value, notifying subscribers of changes, if the value has changed.
public T value { get; set; }Property Value
AdjustableValue<T>.ValueType Property
Gets the runtime type of the value.
public System.Type ValueType { get; }Implements ValueType
Property Value
Methods
AdjustableValue<T>.SetValueWithoutNotify(T) Method
Sets the value without triggering change notifications.
public void SetValueWithoutNotify(T newValue);Parameters
newValue T
The new value to set
Events
AdjustableValue<T>.OnValueChanged Event
Event raised when the value changes.
public event Action<T> OnValueChanged;Implements OnValueChanged