Пример #1
0
        private void DrawActionsColumn(Rect columnRect)
        {
            var labelRect = new Rect(columnRect);

            labelRect.height   = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing * 2;
            columnRect.y      += labelRect.height;
            columnRect.height -= labelRect.height;

            EditorGUI.LabelField(labelRect, GUIContent.none, Styles.actionTreeBackground);
            var headerRect = new Rect(labelRect.x + 1, labelRect.y + 1, labelRect.width - 2, labelRect.height - 2);

            EditorGUI.LabelField(headerRect, m_ActionsGUI, Styles.columnHeaderLabel);

            labelRect.x     = labelRect.x + labelRect.width - (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
            labelRect.width = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
            if (GUI.Button(labelRect, m_AddActionIconGUI, GUIStyle.none))
            {
                m_ContextMenu.OnAddAction();
            }

            // Draw border rect
            EditorGUI.LabelField(columnRect, GUIContent.none, Styles.propertiesBackground);
            // Compensate for the border rect
            columnRect.x      += 1;
            columnRect.height -= 1;
            columnRect.width  -= 2;
            m_ActionsTree.OnGUI(columnRect);
        }
Пример #2
0
        private void DrawActionsColumn(float width)
        {
            EditorGUILayout.BeginVertical(Styles.actionTreeBackground, GUILayout.MaxWidth(width), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();
            var columnRect = GUILayoutUtility.GetLastRect();

            var labelRect = new Rect(columnRect);

            labelRect.height   = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing * 2;
            columnRect.y      += labelRect.height;
            columnRect.height -= labelRect.height;

            EditorGUI.LabelField(labelRect, GUIContent.none, Styles.actionTreeBackground);
            var headerRect = new Rect(labelRect.x + 1, labelRect.y + 1, labelRect.width - 2, labelRect.height - 2);

            EditorGUI.LabelField(headerRect, m_ActionsGUI, Styles.columnHeaderLabel);

            labelRect.x     = labelRect.x + labelRect.width - (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
            labelRect.width = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
            if (GUI.Button(labelRect, m_AddActionIconGUI, GUIStyle.none))
            {
                m_ContextMenu.OnAddAction();
            }

            // Draw border rect
            EditorGUI.LabelField(columnRect, GUIContent.none, Styles.propertiesBackground);
            // Compensate for the border rect
            columnRect.x      += 1;
            columnRect.height -= 1;
            columnRect.width  -= 2;
            m_ActionsTree.OnGUI(columnRect);
        }