-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFirmataEditor.cs
More file actions
24 lines (21 loc) · 787 Bytes
/
FirmataEditor.cs
File metadata and controls
24 lines (21 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#if UNITY_EDITOR
// Editor modifications
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(FirmataBridge))]
public class FirmataEditor : Editor{
string[] portChoices = new string[] { PortSelection.AUTO, PortSelection.COM, PortSelection.PLUS, PortSelection.CHIPKIT, PortSelection.ETHERNET, PortSelection.BLE, PortSelection.WIFI};
int portIndex = 1;
void OnEnable (){
}
public override void OnInspectorGUI (){
serializedObject.Update ();
var firmataBridge = target as FirmataBridge;
portIndex = EditorGUILayout.Popup ("Port Type: ", portIndex, portChoices);
DrawPropertiesExcluding (serializedObject, "m_Script");
firmataBridge.portType = portChoices [portIndex];
serializedObject.ApplyModifiedProperties ();
EditorUtility.SetDirty (target);
}
}
#endif