UnityEngine.GUILayoutUtility.BeginLayoutArea C# (CSharp) Method

BeginLayoutArea() static private method

static private BeginLayoutArea ( GUIStyle style, System layoutType ) : GUILayoutGroup
style GUIStyle
layoutType System
return GUILayoutGroup
        internal static GUILayoutGroup BeginLayoutArea(GUIStyle style, System.Type layoutType)
        {
            GUILayoutGroup next;
            switch (Event.current.type)
            {
                case EventType.Used:
                case EventType.Layout:
                    next = CreateGUILayoutGroupInstanceOfType(layoutType);
                    next.style = style;
                    current.windows.Add(next);
                    break;

                default:
                    next = current.windows.GetNext() as GUILayoutGroup;
                    if (next == null)
                    {
                        throw new ArgumentException("GUILayout: Mismatched LayoutGroup." + Event.current.type);
                    }
                    next.ResetCursor();
                    GUIDebugger.LogLayoutGroupEntry(next.rect, next.margin, next.style, next.isVertical);
                    break;
            }
            current.layoutGroups.Push(next);
            current.topLevel = next;
            return next;
        }

Usage Example

コード例 #1
0
ファイル: GUILayout.cs プロジェクト: qipa/UnityDecompiled-2
        public static void BeginArea(Rect screenRect, GUIContent content, GUIStyle style)
        {
            GUIUtility.CheckOnGUI();
            GUILayoutGroup gUILayoutGroup = GUILayoutUtility.BeginLayoutArea(style, typeof(GUILayoutGroup));

            if (Event.current.type == EventType.Layout)
            {
                gUILayoutGroup.resetCoords = true;
                gUILayoutGroup.minWidth    = (gUILayoutGroup.maxWidth = screenRect.width);
                gUILayoutGroup.minHeight   = (gUILayoutGroup.maxHeight = screenRect.height);
                gUILayoutGroup.rect        = Rect.MinMaxRect(screenRect.xMin, screenRect.yMin, gUILayoutGroup.rect.xMax, gUILayoutGroup.rect.yMax);
            }
            GUI.BeginGroup(gUILayoutGroup.rect, content, style);
        }
All Usage Examples Of UnityEngine.GUILayoutUtility::BeginLayoutArea