Arrays and Complex types

Monitoring Array and Complex Types

Overview

One of Jahro's most powerful features is its ability to monitor arrays and complex types such as vectors, transforms, components, and more. It's not just about simple integers and strings.

[JahroWatch("Player Position", "Tracks the player's position", "Player Data")]
public Vector3 playerPosition;
 
[JahroWatch("Level Data", "Shows data of each level", "Game Data")]
public LevelData[] gameLevels;

In these examples, Jahro displays the playerPosition vector and the gameLevels array in a friendly, easily understandable format (just ensure that custom classes have pretty ToString() method overrided).

jahro commands

Null Values

If an object reference is null, Jahro explicitly shows 'Null' as its value. This feature ensures you can quickly detect potential issues where you might expect a reference, but it's unassigned.

[JahroWatch("Nonexistent Object", "A reference that does not exist", "Test Data")]
public GameObject nonexistentObject;

In this example, if nonexistentObject is not assigned in the Unity editor or through code, Jahro will show 'Null' as its value in Watcher Mode.

Exceptions Handling

Occasionally, accessing a property might result in an exception. Jahro catches these exceptions and provides the specifics about the exception right there in the Watcher Mode.

[JahroWatch("Risky Property", "This property might cause an exception", "Test Data")]
public string riskyProperty
{
    get
    {
        throw new Exception("This is a problematic property!");
    }
}

In the example above, Jahro captures the exception caused by accessing riskyProperty and displays the details in the Watcher Mode.

Detailed Information for Complex Types

For complex types like RectTransform, Jahro goes above and beyond and displays a variety of detailed information. For instance:

[JahroWatch("Camera Transform", "Tracks camera transform properties", "Player Data")]
public Transform cameraTransform;

jahro commands

When watching the cameraTransform above, Jahro provides detailed information about position, rotation, local scale, and child count. This extensive information makes it easier for you to understand the current state of your game objects.