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 theonItemsChangedevent should be raised whenAwake()is called.raiseOnEnable : bool- Whether theonItemsChangedevent should be raised whenOnEnable()is called.raiseOnStart : bool- Whether theonItemsChangedevent 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 theonItemAddedevent with the valueTprovided.RaiseItemRemoved(T)- Manually raises theonItemRemovedevent with the valueTprovided.RaiseItemsChanged- Manually raises theonItemsChangedevent.
NOTE: Manually raising these events will only trigger the UnityEvent actions on this component.