예제 #1
0
        private void ShowGraph(EditorWindow host, Rect position)
        {
            float toolbarHeight = EditorGUIUtility.singleLineHeight + 1.0f;

            graphGUI.BeginGraphGUI(host, new Rect(0, toolbarHeight, position.width, position.height - toolbarHeight));
            graphGUI.OnGraphGUI();
            graphGUI.EndGraphGUI();
        }
예제 #2
0
        /// <summary>
        /// Draw the graph given a host EditorWindow at a Rect position.
        /// </summary>
        /// <param name="host"></param>
        /// <param name="position"></param>
        public void OnGUI(EditorWindow host, Rect position)
        {
            if (graph == null || graphGUI == null)
            {
                Initialize();
            }

            if (graphNeedsUpdate)
            {
                UpdateGraphImmediate();
            }

            using (Horizontal.Do(EditorStyles.toolbar))
            {
                OnToolbarGUI();
            }

            float toolbarHeight = EditorGUIUtility.singleLineHeight + 1.0f;

            graphGUI.BeginGraphGUI(host, new Rect(0, toolbarHeight, position.width, position.height - toolbarHeight));
            graphGUI.OnGraphGUI();
            graphGUI.EndGraphGUI();
        }