Skip to content

AddWatcher Methods

Discover the functionalities of the AddWatcher method in InspectMe Pro. This guide explores how to use watchers for real-time updates on inspected elements, detailing their usage, parameters, and best practices to enhance your Unity debugging experience.

Adding Watchers

You can add a watcher right after your InspectMe() call. Customize the watcher's behavior with various parameters, like notification methods and activation settings.

AddWatcher Method with Callback

Parameters
Parameter Type Description Default Value
watcherCallback Action<T> Callback function to execute when the watched value changes. N/A
startActive bool Indicates if the watcher should start in an active state. true
isContinuous bool Determines if the watcher should continuously monitor changes. false
notifications WatcherNotifications Type of notifications to be triggered on value changes. None
Example Usage
void AddWatcher(Action<T> watcherCallback, bool startActive = true, bool isContinuous = false, WatcherNotifications notifications = WatcherNotifications.None)

AddWatcher Method with Notifications Only

Parameters
Parameter Type Description Default Value
notifications WatcherNotifications Desired types of notifications to be triggered on value changes. N/A
startActive bool Indicates if the watcher should start in an active state. true
isContinuous bool Determines if the watcher should continuously monitor changes. false
Example Usage
void AddWatcher(WatcherNotifications notifications, bool startActive = true, bool isContinuous = false)

Remember

Watchers are primarily for debugging purposes in the Unity Editor and should not be used for game logic in production.


For further assistance, don't hesitate to reach out to our support section.