Пример #1
0
    public static void DrawAllNodes(Rect groupPosition, IList <NodeEditorNode> nodes, NodeEditor nodeEditorWindow, Vector3 cameraPosition)
    {
        float oldLabelWidth = EditorGUIUtility.labelWidth;

        EditorGUIUtility.labelWidth = 75;

        GUI.Box(groupPosition, "");

        GUI.BeginGroup(groupPosition);
        {
            nodeEditorWindow.BeginWindows();
            foreach ((var index, var node) in nodes.Foreach())
            {
                node.DrawGUI(index, cameraPosition, nodeEditorWindow);
            }
            nodeEditorWindow.EndWindows();
        }
        GUI.EndGroup();

        foreach ((var _, var node) in nodes.Foreach())
        {
            node.ProcessEditorEvents(nodeEditorWindow);
        }

        EditorGUIUtility.labelWidth = oldLabelWidth;
    }