12345678910111213141516171819202122232425262728 |
- using System;
- using Tracking;
- using UnityEditor;
- using UnityEngine;
- [CustomEditor(typeof(FrontWheelTracker))]
- public class FrontWheelTrackerEditor : Editor
- {
- public override void OnInspectorGUI()
- {
- var fwt = (FrontWheelTracker) target;
- DrawDefaultInspector();
- if (!EditorApplication.isPlaying) return;
- EditorGUILayout.LabelField("Zero Rot:", fwt.ZeroRot.ToString());
- EditorGUILayout.LabelField("Zero Pos:", fwt.ZeroPos.ToString());
- EditorGUILayout.Space();
- EditorGUILayout.LabelField("Relative Position", fwt.Position.ToString());
- EditorGUILayout.LabelField("Relative Rotation", fwt.Rotation.ToString());
- EditorGUILayout.LabelField("Attach Vive Tracker to Wheel and press Button to calibrate");
- if (GUILayout.Button("Calibrate"))
- {
- fwt.Calibrate();
- }
- }
- }
|