FrontWheelTrackerEditor.cs 839 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using UnityEditor;
  3. using UnityEngine;
  4. [CustomEditor(typeof(FrontWheelTracker))]
  5. public class FrontWheelTrackerEditor : Editor
  6. {
  7. public override void OnInspectorGUI()
  8. {
  9. var fwt = (FrontWheelTracker) target;
  10. DrawDefaultInspector();
  11. EditorGUILayout.LabelField("Zero Rot:", fwt.ZeroRot.ToString());
  12. EditorGUILayout.LabelField("Zero Pos:", fwt.ZeroPos.ToString());
  13. EditorGUILayout.Space();
  14. EditorGUILayout.LabelField("Relative Position", fwt.Position.ToString());
  15. EditorGUILayout.LabelField("Relative Rotation", fwt.Rotation.ToString());
  16. EditorGUILayout.LabelField("Attach Vive Tracker to Wheel and press Button to calibrate");
  17. if (GUILayout.Button("Calibrate"))
  18. {
  19. fwt.Calibrate();
  20. }
  21. }
  22. }