MatchPlayerPosEditor.cs 767 B

1234567891011121314151617181920212223
  1. using Tracking;
  2. using UnityEditor;
  3. using UnityEngine;
  4. [CustomEditor(typeof(MatchPlayerPositionAndCalibrate))]
  5. public class MatchPlayerPosEditor : UnityEditor.Editor
  6. {
  7. private MatchPlayerPositionAndCalibrate matcher;
  8. protected virtual void OnEnable()
  9. {
  10. matcher = (MatchPlayerPositionAndCalibrate) target;
  11. }
  12. public override void OnInspectorGUI()
  13. {
  14. base.OnInspectorGUI();
  15. if (!(EditorApplication.isPlaying || EditorApplication.isPaused)) return;
  16. EditorGUILayout.Space();
  17. EditorGUILayout.LabelField("Make sure that trackers are available, and set the front wheel straight.");
  18. if (GUILayout.Button("Match")) matcher.Match();
  19. // if (GUILayout.Button("MatchLg")) matcher.MatchLeg();
  20. }
  21. }