private void ShowGraphEditor() { // TODO: Ensure only one window instance per-graph is open GraphEditorWindow window = CreateInstance <GraphEditorWindow>(); ExecGraph graph = target as ExecGraph; // Create a toolbar to run/compile var toolbar = new IMGUIContainer(() => { GUILayout.BeginHorizontal(EditorStyles.toolbar); if (GUILayout.Button("Execute", EditorStyles.toolbarButton)) { graph.Execute(); } if (GUILayout.Button("Compile", EditorStyles.toolbarButton)) { graph.Compile(); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); }); window.rootVisualElement.Add(toolbar); window.Show(); window.Load(graph); }
public static bool OpenMachine(int instanceID, int line) { UMachineObject machine = EditorUtility.InstanceIDToObject(instanceID) as UMachineObject; return((machine != null) && (null != GraphEditorWindow.Show(machine))); }
public static bool OpenMachineConfig(int instanceID, int line) { UConfigurableMachine config = EditorUtility.InstanceIDToObject(instanceID) as UConfigurableMachine; return((config != null) && (null != GraphEditorWindow.Show(config))); }
public static bool OpenIncidentConfig(int instanceID, int line) { IncidentConfig config = EditorUtility.InstanceIDToObject(instanceID) as IncidentConfig; return((config != null) && (null != GraphEditorWindow.Show(config))); }