Learning Basics
To get a better understanding of how this tool works, let’s start with the basic concepts involved:
Watch Window
This is the main interface for interacting with your watched variables. It allows you to inspect variables of any type in real-time using Cell or Graph mode. You can also search through variable histories, and Save or Load recorded data for later analysis. The Watch Window is your central hub for tracking and managing variable changes efficiently.
Watch
The main class used to create, destroy, and update variables in your project. It also provides methods for tracking basic variable types, including both auto and manual tracking modes.
Basic and custom variable types
You can watch both basic types and your own custom types:
-
Tracking variables of basic types requires no setup — these are readily available through the
Watch
class methods. The basic types supported are:float
,double
,int
,string
,bool
,char
,decimal
,long
,short
,byte
,ulong
,ushort
, andsbyte
. -
If you need to track custom types, you must first generate them using WatchSchema and WatchGenerator. The generated class will contain the same tracking methods as the
Watch
class, but tailored for your custom types.
Manual and auto tracking mode
There are two ways to expose variables to the Watch window:
- Auto Mode: Call
GetOrAdd
with a getter for your variable, and it will be updated automatically on eachUpdateAll
call. - Manual Mode: Explicitly
Push
variable values when needed. This gives you more control but requires careful use to avoid visual inconsistencies.
WatchReference
An entry point for any operation with a specific watched variable.
This is returned from every watch method in the Watch
class or from your custom-generated class.
You’ll use it for tasks like pushing new values, adding formatting, or changing priority — everything related to managing a watched variable is done through this entity.
WatchSchema
The base class for every code generator schema.
To create your own watchable types, you need to derive from this class, then use the Generate<T>()
method to add new watchable types.
Finally, reference this class file in the WatchGenerator.
WatchGenerator
A Scriptable Object
designed to simplify the code generation for new watchable types.
You define a name for the generated class, provide a reference to the WatchSchema
where the watchable types are described, and set a reference to the output file.
The generated class will contain methods similar to the Watch
class.
By default, the generation process is automatic and triggered by any changes to the linked WatchSchema
class.