LiveWatch is a powerful debugging tool for real-time monitoring of any variable type, with a full history of changes.
Tired of spamming Console with endless values to find bugs? Want to monitor not just the current game state but the entire history of changes? Introducing LiveWatch โ the unique debugging tool that lets you track any variable of any type with every change recorded. Experience the full history of your values, utilize advanced search queries, apply conditional formats, and much more!
Full Change History
Capture every change in your variables over time, making it easy to monitor the state of your game or identify sophisticated bugs. Minimal setup required.
Any type supported
Watch any possible type โ basic types (int, string, bool, float, double, etc.), collections (Dictionary, List, Array, HashSet, etc.), or any other classes from Unity or your own. No Reflection is used at runtime for complex types to achieve maximum performance.
Powerful search
Utilize complex queries to search through all recorded values based on their types and variable names. Queries are unlimited and connected via boolean operators, providing infinite possibilities.
Advanced customization
Change the color format for any variable name or value to highlight important data, including conditional formats based on the values themselves.
Adjustable view
Modify height and width in Cell mode using simple shortcuts based on your needs, or switch to Graph mode to visualize the maximum amount of data changes over time.
Extra text
Add metadata to every pushed value, giving more context about what caused the change. Inspect automatically added stack traces if an exception occurs during the update of your variable.
Flexible API
Add new watches with a single call, and they will be tracked automatically. Or you can push values directly from anywhere in your project as often as needed. All features are accessible through a versatile, well-documented API.
Save/Load functonlaity
Store your variable data as binary files and inspect the recorded values on different devices or projects, providing you with enhanced debugging capabilities.
CURRENT LIMITATIONS
LiveWatch is a powerful tool, though not without its limits. Many of these current limitations are temporary and will be resolved in version 2.0.0.
LiveWatch uses code generation, making it significantly faster than System.Reflection-based solutions. It can handle many variables efficiently, but tracking complex variables may still impact performance, so use it carefully.
Due to code generation, LiveWatch cannot monitor non-public members in custom-generated types. To track them, youโll need to watch these variables directly or expose them via public properties.
Currently, LiveWatch is available only in the Unity Editor. For build use, you can save variable data to a binary file and inspect it in the Editor. Remote debugging capabilities are coming soon.
If you have any inquiries or need assistance, feel free to ask questions!
Improved performance of SetSortOrder (regenerate your watches to apply these changes)
Partially reduced generated code size (more changes in the next update)
Also we created a Discord server for supporting and discussion LiveWatch. Feel free to join to provide some feedback, report bugs or just ask questions regarding the tool if you consider buying it!
There are two dufferent ways of tracking values: auto and manual. And both allow you to track values in any place/moment.
In the first scenario you can call Watch.UpdateAll() (which triggers all auto variables) not just from LateUpdate(), but from any other place like usual Update(), and then using ScriptExecutionOrder ensure that it invokes earlier or in the middle of execution.
In the second scenario you can directly push a value from any place you want just like you can do it using Debug.Log
I am having bit troubles with ecs and this asset. I donโt quite understand how do i get component data with .GetOrAdd method and does calling .GetOrAdd multiple times for same path name cause memory leaks. Example code like towerdefence code would be appreciated for ecs use cases. Also can the Watch.UpdateAll called multiple times in a frame?
Hey! I am going to add full ECS demo in the next updates. Meanwhile let me explain you how itโs supposed to be used. First of all, you are right, Watch.GetOrAdd with getter is supposed to be called once, otherwise it will produce garbage every call. So for cases with ECS components retrieved in OnUpdate itโs better to use Watch.Push which works similar to usual Debug.Log
Here is a small example
public partial class MobHealthSystem : SystemBase
{
protected override void OnUpdate()
{
Entities
.ForEach((Entity entity, ref MobHealth mobHealth) =>
{
// Get or add mob health watch inside empty MobHealths parent watch
// Make sure to generate MobHealth type via code generation or just push a single field like `mobHealth.CurrentHealth`
var healthWatch = Watch.GetOrAdd<Any>("MobHealths")
.GetOrAdd<MobHealth>($"{mobHealth.MobId}"); // or .GetOrAdd<int>($"{mobHealth.MobId}")
Watch.Push(healthWatch, mobHealth); // or Watch.Push(healthWatch, mobHealth.CurrentHealth)
}
}
}
Regarding UpdateAll method itโs completely up to you where to call it and how often, including several times per single frame. Just remember that every call will trigger all watches created via Watch.GetOrAdd to update there values based on getters you passed to them