public void draw() { ge.Name = EditorGUILayout.TextField("Name", ge.Name); foreach (string param in ge.Params) { if (param != "synchronous") { EditorGUILayout.BeginHorizontal(); ge.setParameter(param, ParamEditor.editorFor(param, ge.getParameter(param))); //ge.setParameter (param, EditorGUILayout.ObjectField (param, (Object)ge.getParameter (param), typeof(Object), true)); if (GUILayout.Button("X")) { ge.removeParameter(param); } EditorGUILayout.EndHorizontal(); } } EditorGUILayout.BeginHorizontal(); newParameter = EditorGUILayout.TextField("New Parameter", newParameter); if (GUILayout.Button("Add")) { ge.setParameter(newParameter, null); } EditorGUILayout.EndHorizontal(); }
public override void OnInspectorGUI() { isoSwitches = target as IsoSwitches; GUIStyle style = new GUIStyle(); style.padding = new RectOffset(5, 5, 5, 5); isoSwitches = target as IsoSwitches; EditorGUILayout.HelpBox("List of switches that represent the state of the game.", MessageType.None); ISwitch[] switches = isoSwitches.getList(); if (switches != null) { int i = 0; scrollposition = EditorGUILayout.BeginScrollView(scrollposition, GUILayout.ExpandHeight(true)); foreach (ISwitch isw in switches) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("ID: ", GUILayout.Width(27)); isw.id = EditorGUILayout.TextField(isw.id); isw.State = ParamEditor.editorFor("Initial State: ", isw.State); GUIContent btt = new GUIContent("Remove"); Rect btr = GUILayoutUtility.GetRect(btt, style); if (GUI.Button(btr, btt)) { isoSwitches.removeSwitch(isw); } ; EditorGUILayout.EndHorizontal(); i++; } EditorGUILayout.EndScrollView(); } EditorGUILayout.BeginHorizontal(); GUIContent bttext = new GUIContent("Add Switch"); Rect btrect = GUILayoutUtility.GetRect(bttext, style); if (GUI.Button(btrect, bttext)) { isoSwitches.addSwitch(); } ; EditorGUILayout.EndHorizontal(); }
public void draw() { ge.setParameter("switch", EditorGUILayout.TextField("SwitchID", (string)ge.getParameter("switch"))); ge.setParameter("value", ParamEditor.editorFor("Value", ge.getParameter("value"))); }
public void draw() { isf.id = EditorGUILayout.TextField("ID", isf.id); isf.comparationType = (ISwitchFork.ComparationType)EditorGUILayout.EnumPopup("Comparation Type", isf.comparationType); isf.Value = ParamEditor.editorFor("Value", isf.Value, false); }