1234567891011121314151617181920212223242526 |
- using System;
- using UnityEditor;
- using UnityEngine;
- [CustomEditor(typeof(FrontWheelTracker))]
- public class FrontWheelTrackerEditor : Editor
- {
- public override void OnInspectorGUI()
- {
- var fwt = (FrontWheelTracker) target;
- DrawDefaultInspector();
-
- 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();
- }
- }
- }
|