public override void OnInspectorGUI() { GUI.color = new Color(1, 0.75f, 0.5f); if (GUILayout.Button("Open Editor", GUILayout.Height(40))) { DashEditorWindow.InitEditorWindow(null); DashEditorCore.EditGraph((DashGraph)target); } }
public static bool OpenDashGraphEditor(int p_instanceID, int p_line) { Object asset = EditorUtility.InstanceIDToObject(p_instanceID); if (asset.GetType() == typeof(DashGraph)) { string path = AssetDatabase.GetAssetPath(asset); DashEditorWindow.InitEditorWindow(null); DashEditorCore.EditGraph((DashGraph)AssetDatabase.LoadAssetAtPath <DashGraph>(path)); return(true); } return(false); }
void DrawControllerInfo(Rect p_rect) { if (Graph == null) { return; } GUI.color = Color.white; GUIStyle style = new GUIStyle(); style.normal.textColor = Color.white; style.fontSize = 24; style.fontStyle = FontStyle.Bold; GUI.color = new Color(1, 1, 1, 0.25f); if (Controller != null && Controller.HasBoundGraph) { GUI.Label(new Rect(p_rect.x + 16, p_rect.height - 40, 200, 40), "Bound", style); } else { GUI.Label(new Rect(p_rect.x + 16, p_rect.height - 40, 200, 40), "Asset", style); } if (Controller != null) { style.normal.textColor = Color.yellow; style.fontSize = 18; GUI.Label(new Rect(p_rect.x + 16, p_rect.height - 58, 200, 40), Controller.name, style); } if (GraphUtils.IsSubGraph(DashEditorCore.EditorConfig.editingGraphPath)) { if (GUI.Button(new Rect(p_rect.x + 16, p_rect.height - (Controller == null ? 80 : 98), 100, 32), "GO TO PARENT")) { if (Controller != null) { DashEditorCore.EditController(Controller, GraphUtils.GetParentPath(DashEditorCore.EditorConfig.editingGraphPath)); } else { DashEditorCore.EditGraph(DashEditorCore.EditorConfig.editingRootGraph, GraphUtils.GetParentPath(DashEditorCore.EditorConfig.editingGraphPath)); } } } }