示例#1
0
        private static void FillAddNodes(NodeEditorInputInfo inputInfo, GenericMenu canvasContextMenu)
        {
            NodeEditorState state          = inputInfo.editorState;
            List <Node>     displayedNodes = state.connectOutput != null?NodeTypes.getCompatibleNodes(state.connectOutput) : NodeTypes.nodes.Keys.ToList();

            foreach (Node compatibleNode in displayedNodes)
            {
                if (compatibleNode.GetType().Name == "BuildShader" && NodeEditor.NoBuildShaderContext)
                {
                    continue;
                }
                if (NodeCanvasManager.CheckCanvasCompability(compatibleNode, inputInfo.editorState.canvas.GetType()))
                {
                    canvasContextMenu.AddItem(new GUIContent("" + NodeTypes.nodes[compatibleNode].adress), false, CreateNodeCallback, new NodeEditorInputInfo(compatibleNode.GetID, state));
                }
            }
        }
示例#2
0
        private static void setupBaseFramework()
        {
            ResourceManager.SetDefaultResourcePath(editorPath + "EditorResources/");

            ConnectionTypes.FetchTypes();
            NodeTypes.FetchNodes();
            NodeCanvasManager.GetAllCanvasTypes();

            NodeEditorCallbacks.SetupReceivers();
            NodeEditorCallbacks.IssueOnEditorStartUp();

            NodeEditorInputSystem.SetupInput();

#if UNITY_EDITOR
            UnityEditor.EditorApplication.update -= Update;
            UnityEditor.EditorApplication.update += Update;
#endif

            initiatedBase = true;
        }