Inheritance: UnityEngine.GUILayoutUtility
Beispiel #1
0
        public static void BeginOffsetArea(Rect screenRect, GUIContent content, GUIStyle style)
        {
            GUILayoutGroup guiLayoutGroup = EditorGUILayoutUtilityInternal.BeginLayoutArea(style, typeof(GUILayoutGroup));

            if (Event.current.type == EventType.Layout)
            {
                guiLayoutGroup.resetCoords = false;
                guiLayoutGroup.minWidth    = guiLayoutGroup.maxWidth = screenRect.width + 1f;
                guiLayoutGroup.minHeight   = guiLayoutGroup.maxHeight = screenRect.height + 2f;
                guiLayoutGroup.rect        = Rect.MinMaxRect(-1f, -1f, guiLayoutGroup.rect.xMax, guiLayoutGroup.rect.yMax - 10f);
            }
            GUI.BeginGroup(screenRect, content, style);
        }
Beispiel #2
0
        static public void BeginOffsetArea(Rect screenRect, GUIContent content, GUIStyle style)
        {
            GUILayoutGroup g = EditorGUILayoutUtilityInternal.BeginLayoutArea(style, typeof(GUILayoutGroup));

            switch (Event.current.type)
            {
            case EventType.Layout:
                g.resetCoords = false;
                g.minWidth    = g.maxWidth = screenRect.width + 1;
                g.minHeight   = g.maxHeight = screenRect.height + 2;
                g.rect        = Rect.MinMaxRect(-1, -1, g.rect.xMax, g.rect.yMax - 10);
                break;
            }
            GUI.BeginGroup(screenRect, content, style);
        }