[JahroWatch("Health")]
private int playerHealth = 100;
[JahroWatch("Health")]
private int playerHealth = 100;
[JahroWatch("Health", "The player's current health")]
private int playerHealth = 100;
[JahroWatch("Health", "The player's current health", "Player Stats")]
private int playerHealth = 100;
[JahroWatch("Total Score", "The total score of the game", "Game Stats")]
public static int totalScore;
[JahroWatch("Gravity", "The current gravity value in the game", "Game Settings")]
public static Vector3 gravity { get; private set; }
public class PlayerController : MonoBehaviour
{
[JahroWatch("Player Health", "The current health of the player", "Player Stats")]
public int health;
void Start()
{
Jahro.RegisterObject(this);
}
}
[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;
[JahroWatch("Nonexistent Object", "A reference that does not exist", "Test Data")]
public GameObject nonexistentObject;
[JahroWatch("Risky Property", "This property might cause an exception", "Test Data")]
public string riskyProperty
{
get
{
throw new Exception("This is a problematic property!");
}
}
[JahroWatch("Camera Transform", "Tracks camera transform properties", "Player Data")]
public Transform cameraTransform;
// Assuming these two objects are initialized and updated somewhere in your game
private GameObject player;
private GameObject enemy;
[JahroWatch("Player-Enemy Distance", "Tracks the distance between the player and an enemy", "Gameplay Metrics")]
public float DistanceBetweenPlayerAndEnemy
{
get
{
if (player != null && enemy != null)
{
return Vector3.Distance(player.transform.position, enemy.transform.position);
}
else
{
return -1;
}
}
}
Jahro.UnregisterObject(this);