public static bool OnGraphAssetOpen(int instanceID, int line) { if (typeof(NodeGraph).IsAssignableFrom(EditorUtility.InstanceIDToObject(instanceID).GetType())) { LogicalTheoryWindow window = OpenWindow(); window.OpenGraph(AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(instanceID))); return(true); } return(false); }
public override VisualElement CreateInspectorGUI() { VisualElement container = new VisualElement(); Button openButton = new Button(); openButton.text = "Open Graph"; openButton.clicked += () => { LogicalTheoryWindow window = OpenWindow(); window.OpenGraph(AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath((target as NodeGraph).GetInstanceID()))); }; container.Add(openButton); return(container); }
public bool OnSelectEntry(SearchTreeEntry SearchTreeEntry, SearchWindowContext context) { LogicalTheoryWindow window = EditorWindow.GetWindow <LogicalTheoryWindow>(); Vector2 pos = m_nodeGraphView.contentViewContainer.WorldToLocal( window.rootVisualElement.ChangeCoordinatesTo( window.rootVisualElement.parent, context.screenMousePosition - window.position.position)); if (SearchTreeEntry.userData != null && !(typeof(EntryNode).IsAssignableFrom(SearchTreeEntry.userData as Type))) { m_nodeGraphView.CreateNode(SearchTreeEntry.userData as Type, pos); return(true); } return(false); }