ViveTrackerDebugDisplay.cs 652 B

12345678910111213141516171819202122232425262728
  1. using TMPro;
  2. using Tracking;
  3. using UnityEngine;
  4. namespace Display
  5. {
  6. public class ViveTrackerDebugDisplay : MonoBehaviour
  7. {
  8. public TextMeshProUGUI posText;
  9. public TextMeshProUGUI rotText;
  10. public FrontWheelTracker tracker;
  11. // Start is called before the first frame update
  12. private void Start()
  13. {
  14. }
  15. // Update is called once per frame
  16. private void Update()
  17. {
  18. if (!tracker.isActiveAndEnabled) return;
  19. posText.text = $"Pos: {tracker.Position.ToString()}";
  20. rotText.text = $"Rot: {tracker.Rotation.ToString()}";
  21. }
  22. }
  23. }