RuntimeSetWatcher<T, TSet>
Abstract base class that all other runtime set watchers derive from.
Description
Component that watches a RuntimeSet<T>
for changes and raises events.
Serialized Fields (Inspector)
collection : TSet
- The collection to watch for changes.raiseOnAwake : bool
- Whether theonItemsChanged
event should be raised whenAwake()
is called.raiseOnEnable : bool
- Whether theonItemsChanged
event should be raised whenOnEnable()
is called.raiseOnStart : bool
- Whether theonItemsChanged
event should be raised whenStart()
is called.
Public Events (Inspector)
onItemAdded : UnityEvent<T>
- The actions to perform when an item is added to the set.onItemRemoved : UnityEvent<T>
- The actions to perform when an item is remove from the set.onItemsChanged : UnityEvent
- The actions to perform when an item is added or removed from the set.
Public Properties
Collection : TSet
- The collection being watched for changes.
Public Methods
RaiseItemAdded(T)
- Manually raises theonItemAdded
event with the valueT
provided.RaiseItemRemoved(T)
- Manually raises theonItemRemoved
event with the valueT
provided.RaiseItemsChanged
- Manually raises theonItemsChanged
event.
NOTE: Manually raising these events will only trigger the UnityEvent
actions on this component.