Exemplo n.º 1
0
        private void DrawActionMapsColumn(Rect columnRect)
        {
            var labelRect = new Rect(columnRect);

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

            // Draw header
            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_ActionMapsHeaderGUI, Styles.columnHeaderLabel);

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

            // 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_ActionMapsTree.OnGUI(columnRect);
        }
Exemplo n.º 2
0
        private void DrawActionMapsColumn(float width)
        {
            EditorGUILayout.BeginVertical(Styles.actionTreeBackground, GUILayout.MinWidth(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;

            // Draw header
            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_ActionMapsHeaderGUI, Styles.columnHeaderLabel);

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

            // 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_ActionMapsTree.OnGUI(columnRect);
        }