Watcher

Watcher allows you to track variables or properties in real time, updating every frame. Monitor critical values, debug game state, and group related data inside the Watcher view.



    • Live tracking — see variable changes as they happen
    • Group variables to monitor related data together
    • Works with fields and properties
    • No extra UI needed — just mark values in code and track in-game

Basic Setup

To track a value, mark it with JahroWatch attribute. By default, the field or property name is used as the label.

public class Player : MonoBehaviour
{
    [JahroWatch]  
    public static int Health = 100;
}

The "Health" field will now be visible and updated in real time inside Jahro`s Watcher view.

Grouping Tracked Variables

To organize tracked values, specify a group name in the attribute:

public class Player : MonoBehaviour
{
    [JahroWatch("Health Points", "Stats")]
    public static int Health = 100;
 
    [JahroWatch("Stamina", "Stats", "Remaining stamina")]
    public static int Stamina = 50;
}

Static vs Non-Static Variables

  • Static Fields & Properties - Available globally, no extra setup needed.

  • Non-Static Fields & Properties - Require an instance of the object to be registered.

Static Example

Static variables are automatically tracked without any registration:

public class GameStats  
{  
    [JahroWatch]  
    public static int Score = 0;  
 
    [JahroWatch]  
    public static int EnemiesKilled = 0;  
}

Non-Static Example

For non-static values, you must register the object:

Jahro.RegisterObject(this);

This allows Jahro to track instance-specific values.

public class Player : MonoBehaviour  
{  
    private void Start()  
    {  
        Jahro.RegisterObject(this);  
    }  
 
    [JahroWatch("Player Stats", "Health")]  
    public int Health = 100;  
}

Now, each Player instance will have a separate Health value in the Watcher panel.

➡ Use Jahro.UnregisterObject(this); when the object is destroyed to avoid memory leaks.

Supported Types

Jahro Watcher supports:

    • Primitives (int, float, bool, string)
    • Unity Types (Vector2, Vector3, Quaternion)
    • Arrays & Lists

Null Values and Exceptions

  • Null references are explicitly shown as 'null' in the Watcher view
  • If accessing a property throws an exception, Jahro catches and displays the error details

Best Practices

  • Use descriptive names and groups to organize related variables
  • Remember to unregister objects when they're destroyed to prevent memory leaks
  • Consider performance impact when watching frequently changing values
  • Group related variables together for better organization

Next Steps

    • Collaborate with your team by sharing logs and screenshots in the Web Console