RuntimeVariableWatcher<T, TVar>
Abstract base class that all other runtime variable watchers derive from.
Description
Component that watches a RuntimeVariable<T> for value changes and raises events.
Serialized Fields (Inspector)
variable : TVar- The variable to watch for value changes.raiseOnAwake : bool- Whether theonValueChangedevent should be raised whenAwake()is called.raiseOnEnable : bool- Whether theonValueChangedevent should be raised whenOnEnable()is called.raiseOnStart : bool- Whether theonValueChangedevent should be raised whenStart()is called.
Public Events (Inspector)
onValueChanging : UnityEvent<T>- The actions to perform when the variable value is changing.onValueChanged : UnityEvent<T>- The actions to perform when the variable value has changed.
Public Properties
Variable : TVar(get) - The variable being watched for value changes.
Public Methods
RaiseValueChanging(T)- Manually raises theonValueChangingevent with the value provided.RaiseValueChanged()- Manually raises theonValueChangedevent with the current value of the variable.
NOTE: Manually raising these events will only trigger the UnityEvent actions on this component.