AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
AC_XboxAirplane_Input_Editor.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 using UnityEditor;
5 
6 namespace AirControl
7 {
8  [CustomEditor(typeof(AC_XboxAirplane_Input))]
9  public class AC_XboxAirplane_Input_Editor : Editor
10  {
11  #region Variables
12  private AC_XboxAirplane_Input targetInput;
13  #endregion
14 
15  #region Builtin Methods
16  void OnEnable(){
17  targetInput = (AC_XboxAirplane_Input)target;
18  }
19  public override void OnInspectorGUI()
20  {
21  base.OnInspectorGUI();
22  // Debugger display
23  string debugInfo = "";
24  debugInfo += "Pitch : "+ targetInput.Pitch + "\n";
25  debugInfo += "Roll : "+ targetInput.Roll+ "\n";
26  debugInfo += "Yaw : "+ targetInput.Yaw+ "\n";
27  debugInfo += "Throttle : "+ targetInput.Throttle+ "\n";
28  debugInfo += "Brake : "+ targetInput.Brake+ "\n";
29  debugInfo += "Flaps : "+ targetInput.Flaps+ "\n";
30  debugInfo += "Sticky Throttle "+targetInput.StickyThrottle+ "\n";
31 
32  // custom editor code
33  GUILayout.Space(20);
34  EditorGUILayout.TextArea(debugInfo, GUILayout.Height(120));
35  GUILayout.Space(20);
36  Repaint();
37  }
38  #endregion
39  }
40 
41 }
AirControl.AC_XboxAirplane_Input
Child class listens to xbox Inputs
Definition: AC_XboxAirplane_Input.cs:10
AirControl.AC_XboxAirplane_Input_Editor
Definition: AC_XboxAirplane_Input_Editor.cs:9
AirControl
Definition: AirplaneSelector.cs:8