internal void RequestSearchWindow(Vector2 screenMousePosition) { NodeCreationContext context = new NodeCreationContext(); context.screenMousePosition = screenMousePosition; this.nodeCreationRequest.Invoke(context); }
private void OnCreateNode(NodeCreationContext context) { var windowContext = new SearchWindowContext(context.screenMousePosition, SearchWindowWidth, SearchWindowHeight); SearchWindow.Open(windowContext, m_searchWindowProvider); }
private void OnNodeCreateionRequest(NodeCreationContext context) { if (Selection.activeGameObject != null) { SearchWindow.Open(new SearchWindowContext(context.screenMousePosition), searchWindow); } else { EditorUtility.DisplayDialog("Error Creating Node", "Can not create a logic node, because no gameobject is selected.", "OK"); } }
public void OnDropOutsidePort(Edge edge, Vector2 position) { var graphView = edge.GetFirstAncestorOfType <GraphView>(); if (graphView != null) { var context = new NodeCreationContext(); context.screenMousePosition = position; context.target = edge; graphView.nodeCreationRequest(context); } }
void InsertCreateNodeAction(ContextualMenuPopulateEvent evt, int separatorIndex, int itemIndex) { //we need to arbitrarily add the editor position values because node creation context //exptects a non local coordinate var mousePosition = evt.mousePosition + m_EditorWindow.position.position; var graphView = GetFirstAncestorOfType <MaterialGraphView>(); evt.menu.InsertAction(itemIndex, "Add Block Node", (e) => { var context = new NodeCreationContext { screenMousePosition = mousePosition, target = this, index = separatorIndex, }; graphView.nodeCreationRequest(context); }); }
protected override void OnSeparatorContextualMenuEvent(ContextualMenuPopulateEvent evt, int separatorIndex) { //we need to arbitrarily add the editor position values because node creation context //exptects a non local coordinate Vector2 mousePosition = evt.mousePosition + m_EditorWindow.position.position; base.OnSeparatorContextualMenuEvent(evt, separatorIndex); var graphView = GetFirstAncestorOfType <MaterialGraphView>(); evt.menu.InsertAction(0, "Create Node", (e) => { var context = new NodeCreationContext() { screenMousePosition = mousePosition, target = this, index = separatorIndex, }; graphView.nodeCreationRequest(context); }); }
private void OnRequestNodeCreation(NodeCreationContext context) { // started on empty space if (context.target == null) { // If we have a node selected (but not set as context.target because that's a container for new nodes to go into), search within that node's registry if (Settings.SearchOnSelectedNodeRegistry && _view.selection.Count > 0 && _view.selection.First() is UdonNode) { _focusedSearchWindow.targetRegistry = (_view.selection.First() as UdonNode).Registry; SearchWindow.Open(new SearchWindowContext(context.screenMousePosition, 360, 360), _focusedSearchWindow); } else { // Create Search Window that only searches Top-Level Registries SearchWindow.Open(new SearchWindowContext(context.screenMousePosition, 360, 360), _registrySearchWindow); } } else if (context.target is UdonGraph) { // Slightly hacky method to figure out that we want a full-search window SearchWindow.Open(new SearchWindowContext(context.screenMousePosition, 360, 360), _fullSearchWindow); } }
protected void OnRequestNodeCreation(NodeCreationContext context) { m_InsertStack = context.target as StackNode; m_InsertIndex = context.index; SearchWindow.Open(new SearchWindowContext(context.screenMousePosition), this); }
protected abstract void NodeCreationRequestEventHandler(NodeCreationContext context);
void OnRequestNodeCreation(NodeCreationContext context) { SearchWindow.Open(new SearchWindowContext(context.screenMousePosition), this); }
protected override void NodeCreationRequestEventHandler(NodeCreationContext context) { //CreateNodeWindow.ShowForCreate(this, context.screenMousePosition); }
private void OnShowCreateNode(NodeCreationContext context) { _createPosition = context.screenMousePosition; SearchWindow.Open(new SearchWindowContext(_createPosition), _nodeProvider); }
void OnNodeCreationRequest(NodeCreationContext context) { SearchWindow.Open(new SearchWindowContext(context.screenMousePosition), nodeSearcher); }