// Generic helper - use this when creating a layout group. It will make sure everything is wired up correctly. internal static GUILayoutGroup BeginLayoutArea(GUIStyle style, Type layoutType) { GUILayoutGroup g; switch (Event.current.type) { case EventType.Used: case EventType.Layout: g = CreateGUILayoutGroupInstanceOfType(layoutType); g.style = style; current.windows.Add(g); break; default: g = current.windows.GetNext() as GUILayoutGroup; if (g == null) { throw new ArgumentException("GUILayout: Mismatched LayoutGroup." + Event.current.type); } g.ResetCursor(); GUIDebugger.LogLayoutGroupEntry(g.rect, g.marginLeft, g.marginRight, g.marginTop, g.marginBottom, g.style, g.isVertical); break; } current.layoutGroups.Push(g); current.topLevel = g; return(g); }
internal static GUILayoutGroup BeginLayoutArea(GUIStyle style, Type layoutType) { EventType type = Event.current.type; GUILayoutGroup gUILayoutGroup; if (type != EventType.Used && type != EventType.Layout) { gUILayoutGroup = (GUILayoutUtility.current.windows.GetNext() as GUILayoutGroup); if (gUILayoutGroup == null) { throw new ArgumentException("GUILayout: Mismatched LayoutGroup." + Event.current.type); } gUILayoutGroup.ResetCursor(); GUIDebugger.LogLayoutGroupEntry(gUILayoutGroup.rect, gUILayoutGroup.margin, gUILayoutGroup.style, gUILayoutGroup.isVertical); } else { gUILayoutGroup = GUILayoutUtility.CreateGUILayoutGroupInstanceOfType(layoutType); gUILayoutGroup.style = style; GUILayoutUtility.current.windows.Add(gUILayoutGroup); } GUILayoutUtility.current.layoutGroups.Push(gUILayoutGroup); GUILayoutUtility.current.topLevel = gUILayoutGroup; return(gUILayoutGroup); }
internal static GUILayoutGroup BeginLayoutArea(GUIStyle style, Type layoutType) { EventType type = Event.current.type; EventType eventType = type; GUILayoutGroup gUILayoutGroup; if (eventType != EventType.Layout && eventType != EventType.Used) { gUILayoutGroup = (GUILayoutUtility.current.windows.GetNext() as GUILayoutGroup); bool flag = gUILayoutGroup == null; if (flag) { throw new ExitGUIException("GUILayout: Mismatched LayoutGroup." + Event.current.type.ToString()); } gUILayoutGroup.ResetCursor(); GUIDebugger.LogLayoutGroupEntry(gUILayoutGroup.rect, gUILayoutGroup.marginLeft, gUILayoutGroup.marginRight, gUILayoutGroup.marginTop, gUILayoutGroup.marginBottom, gUILayoutGroup.style, gUILayoutGroup.isVertical); } else { gUILayoutGroup = GUILayoutUtility.CreateGUILayoutGroupInstanceOfType(layoutType); gUILayoutGroup.style = style; GUILayoutUtility.current.windows.Add(gUILayoutGroup); } GUILayoutUtility.current.layoutGroups.Push(gUILayoutGroup); GUILayoutUtility.current.topLevel = gUILayoutGroup; return(gUILayoutGroup); }
internal static GUILayoutGroup BeginLayoutGroup(GUIStyle style, GUILayoutOption[] options, System.Type layoutType) { GUILayoutGroup next; switch (Event.current.type) { case EventType.Used: case EventType.Layout: next = CreateGUILayoutGroupInstanceOfType(layoutType); next.style = style; if (options != null) { next.ApplyOptions(options); } current.topLevel.Add(next); break; default: next = current.topLevel.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); }
// Generic helper - use this when creating a layoutgroup. It will make sure everything is wired up correctly. internal static GUILayoutGroup BeginLayoutGroup(GUIStyle style, GUILayoutOption[] options, Type layoutType) { unbalancedgroupscount++; GUILayoutGroup g; switch (Event.current.type) { case EventType.Used: case EventType.Layout: g = CreateGUILayoutGroupInstanceOfType(layoutType); g.style = style; if (options != null) { g.ApplyOptions(options); } current.topLevel.Add(g); break; default: g = current.topLevel.GetNext() as GUILayoutGroup; if (g == null) { throw new ExitGUIException("GUILayout: Mismatched LayoutGroup." + Event.current.type); } g.ResetCursor(); GUIDebugger.LogLayoutGroupEntry(g.rect, g.marginLeft, g.marginRight, g.marginTop, g.marginBottom, g.style, g.isVertical); break; } current.layoutGroups.Push(g); current.topLevel = g; return(g); }