예제 #1
0
        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);
        }
예제 #3
0
 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");
     }
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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);
            });
        }
예제 #6
0
        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);
            });
        }
예제 #7
0
 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);
 }
예제 #9
0
 protected abstract void NodeCreationRequestEventHandler(NodeCreationContext context);
 void OnRequestNodeCreation(NodeCreationContext context)
 {
     SearchWindow.Open(new SearchWindowContext(context.screenMousePosition), this);
 }
예제 #11
0
 protected override void NodeCreationRequestEventHandler(NodeCreationContext context)
 {
     //CreateNodeWindow.ShowForCreate(this, context.screenMousePosition);
 }
예제 #12
0
 private void OnShowCreateNode(NodeCreationContext context)
 {
     _createPosition = context.screenMousePosition;
     SearchWindow.Open(new SearchWindowContext(_createPosition), _nodeProvider);
 }
예제 #13
0
 void OnNodeCreationRequest(NodeCreationContext context)
 {
     SearchWindow.Open(new SearchWindowContext(context.screenMousePosition), nodeSearcher);
 }