Пример #1
0
    private List<NodeShelfGroup> getTypesOfShelfGroups()
    {
        List<NodeShelfGroup> list = new List<NodeShelfGroup>();

        string[] subDirectories = Directory.GetDirectories(Application.dataPath + "/SimpleMathNodeEditor/Database/");
        int pathLengthWithName = (Application.dataPath + "/SimpleMathNodeEditor/Database/").Length;

        foreach (string s in subDirectories)
        {
            NodeShelfGroup nsg = new NodeShelfGroup();
            nsg.nodeTypeView = this;
            nsg.groupPath = s;
            nsg.groupName = s.Substring(pathLengthWithName);
            nsg.getTypesOfShelfGroups();

            nsg.shelfNodes = nsg.getTypesOfShelfGroups();

            list.Add(nsg);
        }

        return list;
    }
Пример #2
0
    private void showAllBasicNodes()
    {
        for (int i = 0; i < currentNodeGraph.typesOfNodes.Count; i++)
        {
            XMLUtilities.changeHiddenNodeState(currentNodeGraph.typesOfNodes[i].nodeName, false);
            currentNodeGraph.typesOfNodes[i].isHidden = false;
        }

        foreach (NodeShelfGroup g in typesOfShelfGroups)
        {
                selectedNodeShelfGroup = g;
                foreach (NodeShelfGroupNode n in selectedNodeShelfGroup.shelfNodes)
                {
                    n.isHidden = false;
                }
        }
    }
Пример #3
0
    public void ProcessContextEvent(Event e)
    {
        if (viewRect.Contains(e.mousePosition))
        {
            if (e.button == 1) // Right Mouseclick
            {
                if (e.type == EventType.MouseDown)
                {
                    selectedNodeShelfGroup = null;
                    selectedNodeShelfNode = null;
                    selectedBasicNode = null;
                    foreach (NodeShelfGroup g in typesOfShelfGroups)
                    {
                        if (g.groupRect.Contains(e.mousePosition))
                        {
                            selectedNodeShelfGroup = g;
                            foreach (NodeShelfGroupNode n in selectedNodeShelfGroup.shelfNodes)
                            {
                                if (n.shelfNodeRect.Contains(e.mousePosition))
                                {
                                    selectedNodeShelfNode = n;
                                }
                            }
                        }
                    }

                    for (int i = 0; i < currentNodeGraph.typesOfNodes.Count; i++)
                    {
                        if (basicNodeRects != null)
                        {
                            if (basicNodeRects[i].Contains(e.mousePosition))
                            {
                                selectedBasicNode = currentNodeGraph.typesOfNodes[i];
                            }
                        }
                    }
                    ProcessContextMenu(e);
                }
            }
        }
    }