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 theonValueChanged
event should be raised whenAwake()
is called.raiseOnEnable : bool
- Whether theonValueChanged
event should be raised whenOnEnable()
is called.raiseOnStart : bool
- Whether theonValueChanged
event 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 theonValueChanging
event with the value provided.RaiseValueChanged()
- Manually raises theonValueChanged
event with the current value of the variable.
NOTE: Manually raising these events will only trigger the UnityEvent
actions on this component.