Exemplo n.º 1
0
        private void OnGUI()
        {
            if (_fmWindow == null)
            {
                _fmWindow = GetWindow <FMWindow>();
            }

            Node selectedNode = null;

            var graph = _fmWindow.GraphStack.CurrentGraph;

            if (!graph)
            {
                return;
            }
            selectedNode = graph.Editor().SelectedNode;

            GUILayout.BeginVertical();

            EditorGUILayout.Space();

            //_scrollPos = EditorGUILayout.BeginScrollView(_scrollPos);

            if (selectedNode)
            {
                selectedNode.Editor().OnInspector();
            }
            else
            {
                var selectedGroup = graph.Editor().SelectedGroup;
                if (selectedGroup)
                {
                    selectedGroup.Editor().OnInspector();
                }
            }

            // Set window size to fit content
            GUILayout.EndVertical();

            if (Event.current.type == EventType.Repaint)
            {
                var lastRect = GUILayoutUtility.GetLastRect();

                var height = lastRect.y + lastRect.height + 5;

                maxSize = new Vector2(100000, height);
                minSize = new Vector2(100, height);
            }
        }
 public EditorToolsImplimantation(FMWindow window)
 {
     _window     = window;
     _editorEdge = new EdgeEditor(window);
 }