596 lines
21 KiB
C#
596 lines
21 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Security;
|
|
using UnityEngine.Scripting;
|
|
using UnityEngineInternal;
|
|
|
|
namespace UnityEngine
|
|
{
|
|
// Token: 0x0200026F RID: 623
|
|
public class GUILayoutUtility
|
|
{
|
|
// Token: 0x06002A6B RID: 10859 RVA: 0x00037034 File Offset: 0x00035234
|
|
internal static void CleanupRoots()
|
|
{
|
|
GUILayoutUtility.s_SpaceStyle = null;
|
|
GUILayoutUtility.s_StoredLayouts = null;
|
|
GUILayoutUtility.s_StoredWindows = null;
|
|
GUILayoutUtility.current = null;
|
|
}
|
|
|
|
// Token: 0x06002A6C RID: 10860 RVA: 0x00037050 File Offset: 0x00035250
|
|
internal static GUILayoutUtility.LayoutCache SelectIDList(int instanceID, bool isWindow)
|
|
{
|
|
Dictionary<int, GUILayoutUtility.LayoutCache> dictionary = ((!isWindow) ? GUILayoutUtility.s_StoredLayouts : GUILayoutUtility.s_StoredWindows);
|
|
GUILayoutUtility.LayoutCache layoutCache;
|
|
if (!dictionary.TryGetValue(instanceID, out layoutCache))
|
|
{
|
|
layoutCache = new GUILayoutUtility.LayoutCache();
|
|
dictionary[instanceID] = layoutCache;
|
|
}
|
|
GUILayoutUtility.current.topLevel = layoutCache.topLevel;
|
|
GUILayoutUtility.current.layoutGroups = layoutCache.layoutGroups;
|
|
GUILayoutUtility.current.windows = layoutCache.windows;
|
|
return layoutCache;
|
|
}
|
|
|
|
// Token: 0x06002A6D RID: 10861 RVA: 0x000370D4 File Offset: 0x000352D4
|
|
internal static void Begin(int instanceID)
|
|
{
|
|
GUILayoutUtility.LayoutCache layoutCache = GUILayoutUtility.SelectIDList(instanceID, false);
|
|
if (Event.current.type == EventType.Layout)
|
|
{
|
|
GUILayoutUtility.current.topLevel = (layoutCache.topLevel = new GUILayoutGroup());
|
|
GUILayoutUtility.current.layoutGroups.Clear();
|
|
GUILayoutUtility.current.layoutGroups.Push(GUILayoutUtility.current.topLevel);
|
|
GUILayoutUtility.current.windows = (layoutCache.windows = new GUILayoutGroup());
|
|
}
|
|
else
|
|
{
|
|
GUILayoutUtility.current.topLevel = layoutCache.topLevel;
|
|
GUILayoutUtility.current.layoutGroups = layoutCache.layoutGroups;
|
|
GUILayoutUtility.current.windows = layoutCache.windows;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002A6E RID: 10862 RVA: 0x0003718C File Offset: 0x0003538C
|
|
internal static void BeginContainer(GUILayoutUtility.LayoutCache cache)
|
|
{
|
|
if (Event.current.type == EventType.Layout)
|
|
{
|
|
GUILayoutUtility.current.topLevel = (cache.topLevel = new GUILayoutGroup());
|
|
GUILayoutUtility.current.layoutGroups.Clear();
|
|
GUILayoutUtility.current.layoutGroups.Push(GUILayoutUtility.current.topLevel);
|
|
GUILayoutUtility.current.windows = (cache.windows = new GUILayoutGroup());
|
|
}
|
|
else
|
|
{
|
|
GUILayoutUtility.current.topLevel = cache.topLevel;
|
|
GUILayoutUtility.current.layoutGroups = cache.layoutGroups;
|
|
GUILayoutUtility.current.windows = cache.windows;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002A6F RID: 10863 RVA: 0x0003723C File Offset: 0x0003543C
|
|
internal static void BeginWindow(int windowID, GUIStyle style, GUILayoutOption[] options)
|
|
{
|
|
GUILayoutUtility.LayoutCache layoutCache = GUILayoutUtility.SelectIDList(windowID, true);
|
|
if (Event.current.type == EventType.Layout)
|
|
{
|
|
GUILayoutUtility.current.topLevel = (layoutCache.topLevel = new GUILayoutGroup());
|
|
GUILayoutUtility.current.topLevel.style = style;
|
|
GUILayoutUtility.current.topLevel.windowID = windowID;
|
|
if (options != null)
|
|
{
|
|
GUILayoutUtility.current.topLevel.ApplyOptions(options);
|
|
}
|
|
GUILayoutUtility.current.layoutGroups.Clear();
|
|
GUILayoutUtility.current.layoutGroups.Push(GUILayoutUtility.current.topLevel);
|
|
GUILayoutUtility.current.windows = (layoutCache.windows = new GUILayoutGroup());
|
|
}
|
|
else
|
|
{
|
|
GUILayoutUtility.current.topLevel = layoutCache.topLevel;
|
|
GUILayoutUtility.current.layoutGroups = layoutCache.layoutGroups;
|
|
GUILayoutUtility.current.windows = layoutCache.windows;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002A70 RID: 10864 RVA: 0x0003732C File Offset: 0x0003552C
|
|
[Obsolete("BeginGroup has no effect and will be removed", false)]
|
|
public static void BeginGroup(string GroupName)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06002A71 RID: 10865 RVA: 0x00037330 File Offset: 0x00035530
|
|
[Obsolete("EndGroup has no effect and will be removed", false)]
|
|
public static void EndGroup(string groupName)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06002A72 RID: 10866 RVA: 0x00037334 File Offset: 0x00035534
|
|
internal static void Layout()
|
|
{
|
|
if (GUILayoutUtility.current.topLevel.windowID == -1)
|
|
{
|
|
GUILayoutUtility.current.topLevel.CalcWidth();
|
|
GUILayoutUtility.current.topLevel.SetHorizontal(0f, Mathf.Min((float)Screen.width / GUIUtility.pixelsPerPoint, GUILayoutUtility.current.topLevel.maxWidth));
|
|
GUILayoutUtility.current.topLevel.CalcHeight();
|
|
GUILayoutUtility.current.topLevel.SetVertical(0f, Mathf.Min((float)Screen.height / GUIUtility.pixelsPerPoint, GUILayoutUtility.current.topLevel.maxHeight));
|
|
GUILayoutUtility.LayoutFreeGroup(GUILayoutUtility.current.windows);
|
|
}
|
|
else
|
|
{
|
|
GUILayoutUtility.LayoutSingleGroup(GUILayoutUtility.current.topLevel);
|
|
GUILayoutUtility.LayoutFreeGroup(GUILayoutUtility.current.windows);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002A73 RID: 10867 RVA: 0x00037414 File Offset: 0x00035614
|
|
internal static void LayoutFromEditorWindow()
|
|
{
|
|
GUILayoutUtility.current.topLevel.CalcWidth();
|
|
GUILayoutUtility.current.topLevel.SetHorizontal(0f, (float)Screen.width / GUIUtility.pixelsPerPoint);
|
|
GUILayoutUtility.current.topLevel.CalcHeight();
|
|
GUILayoutUtility.current.topLevel.SetVertical(0f, (float)Screen.height / GUIUtility.pixelsPerPoint);
|
|
GUILayoutUtility.LayoutFreeGroup(GUILayoutUtility.current.windows);
|
|
}
|
|
|
|
// Token: 0x06002A74 RID: 10868 RVA: 0x00037490 File Offset: 0x00035690
|
|
internal static void LayoutFromContainer(float w, float h)
|
|
{
|
|
GUILayoutUtility.current.topLevel.CalcWidth();
|
|
GUILayoutUtility.current.topLevel.SetHorizontal(0f, w);
|
|
GUILayoutUtility.current.topLevel.CalcHeight();
|
|
GUILayoutUtility.current.topLevel.SetVertical(0f, h);
|
|
GUILayoutUtility.LayoutFreeGroup(GUILayoutUtility.current.windows);
|
|
}
|
|
|
|
// Token: 0x06002A75 RID: 10869 RVA: 0x000374F8 File Offset: 0x000356F8
|
|
internal static float LayoutFromInspector(float width)
|
|
{
|
|
float num;
|
|
if (GUILayoutUtility.current.topLevel != null && GUILayoutUtility.current.topLevel.windowID == -1)
|
|
{
|
|
GUILayoutUtility.current.topLevel.CalcWidth();
|
|
GUILayoutUtility.current.topLevel.SetHorizontal(0f, width);
|
|
GUILayoutUtility.current.topLevel.CalcHeight();
|
|
GUILayoutUtility.current.topLevel.SetVertical(0f, Mathf.Min((float)Screen.height / GUIUtility.pixelsPerPoint, GUILayoutUtility.current.topLevel.maxHeight));
|
|
float minHeight = GUILayoutUtility.current.topLevel.minHeight;
|
|
GUILayoutUtility.LayoutFreeGroup(GUILayoutUtility.current.windows);
|
|
num = minHeight;
|
|
}
|
|
else
|
|
{
|
|
if (GUILayoutUtility.current.topLevel != null)
|
|
{
|
|
GUILayoutUtility.LayoutSingleGroup(GUILayoutUtility.current.topLevel);
|
|
}
|
|
num = 0f;
|
|
}
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x06002A76 RID: 10870 RVA: 0x000375E4 File Offset: 0x000357E4
|
|
internal static void LayoutFreeGroup(GUILayoutGroup toplevel)
|
|
{
|
|
foreach (GUILayoutEntry guilayoutEntry in toplevel.entries)
|
|
{
|
|
GUILayoutGroup guilayoutGroup = (GUILayoutGroup)guilayoutEntry;
|
|
GUILayoutUtility.LayoutSingleGroup(guilayoutGroup);
|
|
}
|
|
toplevel.ResetCursor();
|
|
}
|
|
|
|
// Token: 0x06002A77 RID: 10871 RVA: 0x00037650 File Offset: 0x00035850
|
|
private static void LayoutSingleGroup(GUILayoutGroup i)
|
|
{
|
|
if (!i.isWindow)
|
|
{
|
|
float minWidth = i.minWidth;
|
|
float maxWidth = i.maxWidth;
|
|
i.CalcWidth();
|
|
i.SetHorizontal(i.rect.x, Mathf.Clamp(i.maxWidth, minWidth, maxWidth));
|
|
float minHeight = i.minHeight;
|
|
float maxHeight = i.maxHeight;
|
|
i.CalcHeight();
|
|
i.SetVertical(i.rect.y, Mathf.Clamp(i.maxHeight, minHeight, maxHeight));
|
|
}
|
|
else
|
|
{
|
|
i.CalcWidth();
|
|
Rect rect = GUILayoutUtility.Internal_GetWindowRect(i.windowID);
|
|
i.SetHorizontal(rect.x, Mathf.Clamp(rect.width, i.minWidth, i.maxWidth));
|
|
i.CalcHeight();
|
|
i.SetVertical(rect.y, Mathf.Clamp(rect.height, i.minHeight, i.maxHeight));
|
|
GUILayoutUtility.Internal_MoveWindow(i.windowID, i.rect);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002A78 RID: 10872 RVA: 0x0003774C File Offset: 0x0003594C
|
|
[SecuritySafeCritical]
|
|
private static GUILayoutGroup CreateGUILayoutGroupInstanceOfType(Type LayoutType)
|
|
{
|
|
if (!typeof(GUILayoutGroup).IsAssignableFrom(LayoutType))
|
|
{
|
|
throw new ArgumentException("LayoutType needs to be of type GUILayoutGroup");
|
|
}
|
|
return (GUILayoutGroup)Activator.CreateInstance(LayoutType);
|
|
}
|
|
|
|
// Token: 0x06002A79 RID: 10873 RVA: 0x0003778C File Offset: 0x0003598C
|
|
internal static GUILayoutGroup BeginLayoutGroup(GUIStyle style, GUILayoutOption[] options, Type layoutType)
|
|
{
|
|
EventType type = Event.current.type;
|
|
GUILayoutGroup guilayoutGroup;
|
|
if (type != EventType.Used && type != EventType.Layout)
|
|
{
|
|
guilayoutGroup = GUILayoutUtility.current.topLevel.GetNext() as GUILayoutGroup;
|
|
if (guilayoutGroup == null)
|
|
{
|
|
throw new ArgumentException("GUILayout: Mismatched LayoutGroup." + Event.current.type);
|
|
}
|
|
guilayoutGroup.ResetCursor();
|
|
}
|
|
else
|
|
{
|
|
guilayoutGroup = GUILayoutUtility.CreateGUILayoutGroupInstanceOfType(layoutType);
|
|
guilayoutGroup.style = style;
|
|
if (options != null)
|
|
{
|
|
guilayoutGroup.ApplyOptions(options);
|
|
}
|
|
GUILayoutUtility.current.topLevel.Add(guilayoutGroup);
|
|
}
|
|
GUILayoutUtility.current.layoutGroups.Push(guilayoutGroup);
|
|
GUILayoutUtility.current.topLevel = guilayoutGroup;
|
|
return guilayoutGroup;
|
|
}
|
|
|
|
// Token: 0x06002A7A RID: 10874 RVA: 0x00037854 File Offset: 0x00035A54
|
|
internal static void EndLayoutGroup()
|
|
{
|
|
EventType type = Event.current.type;
|
|
GUILayoutUtility.current.layoutGroups.Pop();
|
|
GUILayoutUtility.current.topLevel = ((0 >= GUILayoutUtility.current.layoutGroups.Count) ? null : ((GUILayoutGroup)GUILayoutUtility.current.layoutGroups.Peek()));
|
|
}
|
|
|
|
// Token: 0x06002A7B RID: 10875 RVA: 0x000378BC File Offset: 0x00035ABC
|
|
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();
|
|
}
|
|
else
|
|
{
|
|
guilayoutGroup = GUILayoutUtility.CreateGUILayoutGroupInstanceOfType(layoutType);
|
|
guilayoutGroup.style = style;
|
|
GUILayoutUtility.current.windows.Add(guilayoutGroup);
|
|
}
|
|
GUILayoutUtility.current.layoutGroups.Push(guilayoutGroup);
|
|
GUILayoutUtility.current.topLevel = guilayoutGroup;
|
|
return guilayoutGroup;
|
|
}
|
|
|
|
// Token: 0x06002A7C RID: 10876 RVA: 0x00037974 File Offset: 0x00035B74
|
|
internal static GUILayoutGroup DoBeginLayoutArea(GUIStyle style, Type layoutType)
|
|
{
|
|
return GUILayoutUtility.BeginLayoutArea(style, layoutType);
|
|
}
|
|
|
|
// Token: 0x170009BE RID: 2494
|
|
// (get) Token: 0x06002A7D RID: 10877 RVA: 0x00037990 File Offset: 0x00035B90
|
|
internal static GUILayoutGroup topLevel
|
|
{
|
|
get
|
|
{
|
|
return GUILayoutUtility.current.topLevel;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002A7E RID: 10878 RVA: 0x000379B0 File Offset: 0x00035BB0
|
|
public static Rect GetRect(GUIContent content, GUIStyle style)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(content, style, null);
|
|
}
|
|
|
|
// Token: 0x06002A7F RID: 10879 RVA: 0x000379D0 File Offset: 0x00035BD0
|
|
public static Rect GetRect(GUIContent content, GUIStyle style, params GUILayoutOption[] options)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(content, style, options);
|
|
}
|
|
|
|
// Token: 0x06002A80 RID: 10880 RVA: 0x000379F0 File Offset: 0x00035BF0
|
|
private static Rect DoGetRect(GUIContent content, GUIStyle style, GUILayoutOption[] options)
|
|
{
|
|
GUIUtility.CheckOnGUI();
|
|
EventType type = Event.current.type;
|
|
Rect rect;
|
|
if (type != EventType.Layout)
|
|
{
|
|
if (type != EventType.Used)
|
|
{
|
|
GUILayoutEntry next = GUILayoutUtility.current.topLevel.GetNext();
|
|
rect = next.rect;
|
|
}
|
|
else
|
|
{
|
|
rect = GUILayoutUtility.kDummyRect;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (style.isHeightDependantOnWidth)
|
|
{
|
|
GUILayoutUtility.current.topLevel.Add(new GUIWordWrapSizer(style, content, options));
|
|
}
|
|
else
|
|
{
|
|
Vector2 vector = new Vector2(0f, 0f);
|
|
if (options != null)
|
|
{
|
|
foreach (GUILayoutOption guilayoutOption in options)
|
|
{
|
|
GUILayoutOption.Type type2 = guilayoutOption.type;
|
|
if (type2 != GUILayoutOption.Type.maxHeight)
|
|
{
|
|
if (type2 == GUILayoutOption.Type.maxWidth)
|
|
{
|
|
vector.x = (float)guilayoutOption.value;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
vector.y = (float)guilayoutOption.value;
|
|
}
|
|
}
|
|
}
|
|
Vector2 vector2 = style.CalcSizeWithConstraints(content, vector);
|
|
GUILayoutUtility.current.topLevel.Add(new GUILayoutEntry(vector2.x, vector2.x, vector2.y, vector2.y, style, options));
|
|
}
|
|
rect = GUILayoutUtility.kDummyRect;
|
|
}
|
|
return rect;
|
|
}
|
|
|
|
// Token: 0x06002A81 RID: 10881 RVA: 0x00037B48 File Offset: 0x00035D48
|
|
public static Rect GetRect(float width, float height)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(width, width, height, height, GUIStyle.none, null);
|
|
}
|
|
|
|
// Token: 0x06002A82 RID: 10882 RVA: 0x00037B6C File Offset: 0x00035D6C
|
|
public static Rect GetRect(float width, float height, GUIStyle style)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(width, width, height, height, style, null);
|
|
}
|
|
|
|
// Token: 0x06002A83 RID: 10883 RVA: 0x00037B8C File Offset: 0x00035D8C
|
|
public static Rect GetRect(float width, float height, params GUILayoutOption[] options)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(width, width, height, height, GUIStyle.none, options);
|
|
}
|
|
|
|
// Token: 0x06002A84 RID: 10884 RVA: 0x00037BB0 File Offset: 0x00035DB0
|
|
public static Rect GetRect(float width, float height, GUIStyle style, params GUILayoutOption[] options)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(width, width, height, height, style, options);
|
|
}
|
|
|
|
// Token: 0x06002A85 RID: 10885 RVA: 0x00037BD0 File Offset: 0x00035DD0
|
|
public static Rect GetRect(float minWidth, float maxWidth, float minHeight, float maxHeight)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(minWidth, maxWidth, minHeight, maxHeight, GUIStyle.none, null);
|
|
}
|
|
|
|
// Token: 0x06002A86 RID: 10886 RVA: 0x00037BF4 File Offset: 0x00035DF4
|
|
public static Rect GetRect(float minWidth, float maxWidth, float minHeight, float maxHeight, GUIStyle style)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(minWidth, maxWidth, minHeight, maxHeight, style, null);
|
|
}
|
|
|
|
// Token: 0x06002A87 RID: 10887 RVA: 0x00037C18 File Offset: 0x00035E18
|
|
public static Rect GetRect(float minWidth, float maxWidth, float minHeight, float maxHeight, params GUILayoutOption[] options)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(minWidth, maxWidth, minHeight, maxHeight, GUIStyle.none, options);
|
|
}
|
|
|
|
// Token: 0x06002A88 RID: 10888 RVA: 0x00037C40 File Offset: 0x00035E40
|
|
public static Rect GetRect(float minWidth, float maxWidth, float minHeight, float maxHeight, GUIStyle style, params GUILayoutOption[] options)
|
|
{
|
|
return GUILayoutUtility.DoGetRect(minWidth, maxWidth, minHeight, maxHeight, style, options);
|
|
}
|
|
|
|
// Token: 0x06002A89 RID: 10889 RVA: 0x00037C64 File Offset: 0x00035E64
|
|
private static Rect DoGetRect(float minWidth, float maxWidth, float minHeight, float maxHeight, GUIStyle style, GUILayoutOption[] options)
|
|
{
|
|
EventType type = Event.current.type;
|
|
Rect rect;
|
|
if (type != EventType.Layout)
|
|
{
|
|
if (type != EventType.Used)
|
|
{
|
|
rect = GUILayoutUtility.current.topLevel.GetNext().rect;
|
|
}
|
|
else
|
|
{
|
|
rect = GUILayoutUtility.kDummyRect;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
GUILayoutUtility.current.topLevel.Add(new GUILayoutEntry(minWidth, maxWidth, minHeight, maxHeight, style, options));
|
|
rect = GUILayoutUtility.kDummyRect;
|
|
}
|
|
return rect;
|
|
}
|
|
|
|
// Token: 0x06002A8A RID: 10890 RVA: 0x00037CE0 File Offset: 0x00035EE0
|
|
public static Rect GetLastRect()
|
|
{
|
|
EventType type = Event.current.type;
|
|
Rect last;
|
|
if (type != EventType.Layout && type != EventType.Used)
|
|
{
|
|
last = GUILayoutUtility.current.topLevel.GetLast();
|
|
}
|
|
else
|
|
{
|
|
last = GUILayoutUtility.kDummyRect;
|
|
}
|
|
return last;
|
|
}
|
|
|
|
// Token: 0x06002A8B RID: 10891 RVA: 0x00037D30 File Offset: 0x00035F30
|
|
public static Rect GetAspectRect(float aspect)
|
|
{
|
|
return GUILayoutUtility.DoGetAspectRect(aspect, GUIStyle.none, null);
|
|
}
|
|
|
|
// Token: 0x06002A8C RID: 10892 RVA: 0x00037D54 File Offset: 0x00035F54
|
|
public static Rect GetAspectRect(float aspect, GUIStyle style)
|
|
{
|
|
return GUILayoutUtility.DoGetAspectRect(aspect, style, null);
|
|
}
|
|
|
|
// Token: 0x06002A8D RID: 10893 RVA: 0x00037D74 File Offset: 0x00035F74
|
|
public static Rect GetAspectRect(float aspect, params GUILayoutOption[] options)
|
|
{
|
|
return GUILayoutUtility.DoGetAspectRect(aspect, GUIStyle.none, options);
|
|
}
|
|
|
|
// Token: 0x06002A8E RID: 10894 RVA: 0x00037D98 File Offset: 0x00035F98
|
|
public static Rect GetAspectRect(float aspect, GUIStyle style, params GUILayoutOption[] options)
|
|
{
|
|
return GUILayoutUtility.DoGetAspectRect(aspect, GUIStyle.none, options);
|
|
}
|
|
|
|
// Token: 0x06002A8F RID: 10895 RVA: 0x00037DBC File Offset: 0x00035FBC
|
|
private static Rect DoGetAspectRect(float aspect, GUIStyle style, GUILayoutOption[] options)
|
|
{
|
|
EventType type = Event.current.type;
|
|
Rect rect;
|
|
if (type != EventType.Layout)
|
|
{
|
|
if (type != EventType.Used)
|
|
{
|
|
rect = GUILayoutUtility.current.topLevel.GetNext().rect;
|
|
}
|
|
else
|
|
{
|
|
rect = GUILayoutUtility.kDummyRect;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
GUILayoutUtility.current.topLevel.Add(new GUIAspectSizer(aspect, options));
|
|
rect = GUILayoutUtility.kDummyRect;
|
|
}
|
|
return rect;
|
|
}
|
|
|
|
// Token: 0x170009BF RID: 2495
|
|
// (get) Token: 0x06002A90 RID: 10896 RVA: 0x00037E30 File Offset: 0x00036030
|
|
internal static GUIStyle spaceStyle
|
|
{
|
|
get
|
|
{
|
|
if (GUILayoutUtility.s_SpaceStyle == null)
|
|
{
|
|
GUILayoutUtility.s_SpaceStyle = new GUIStyle();
|
|
}
|
|
GUILayoutUtility.s_SpaceStyle.stretchWidth = false;
|
|
return GUILayoutUtility.s_SpaceStyle;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06002A91 RID: 10897 RVA: 0x00037E6C File Offset: 0x0003606C
|
|
private static Rect Internal_GetWindowRect(int windowID)
|
|
{
|
|
Rect rect;
|
|
GUILayoutUtility.INTERNAL_CALL_Internal_GetWindowRect(windowID, out rect);
|
|
return rect;
|
|
}
|
|
|
|
// Token: 0x06002A92 RID: 10898
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_Internal_GetWindowRect(int windowID, out Rect value);
|
|
|
|
// Token: 0x06002A93 RID: 10899 RVA: 0x00037E8C File Offset: 0x0003608C
|
|
private static void Internal_MoveWindow(int windowID, Rect r)
|
|
{
|
|
GUILayoutUtility.INTERNAL_CALL_Internal_MoveWindow(windowID, ref r);
|
|
}
|
|
|
|
// Token: 0x06002A94 RID: 10900
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_Internal_MoveWindow(int windowID, ref Rect r);
|
|
|
|
// Token: 0x06002A95 RID: 10901 RVA: 0x00037E98 File Offset: 0x00036098
|
|
internal static Rect GetWindowsBounds()
|
|
{
|
|
Rect rect;
|
|
GUILayoutUtility.INTERNAL_CALL_GetWindowsBounds(out rect);
|
|
return rect;
|
|
}
|
|
|
|
// Token: 0x06002A96 RID: 10902
|
|
[GeneratedByOldBindingsGenerator]
|
|
[MethodImpl(MethodImplOptions.InternalCall)]
|
|
private static extern void INTERNAL_CALL_GetWindowsBounds(out Rect value);
|
|
|
|
// Token: 0x04000794 RID: 1940
|
|
private static Dictionary<int, GUILayoutUtility.LayoutCache> s_StoredLayouts = new Dictionary<int, GUILayoutUtility.LayoutCache>();
|
|
|
|
// Token: 0x04000795 RID: 1941
|
|
private static Dictionary<int, GUILayoutUtility.LayoutCache> s_StoredWindows = new Dictionary<int, GUILayoutUtility.LayoutCache>();
|
|
|
|
// Token: 0x04000796 RID: 1942
|
|
internal static GUILayoutUtility.LayoutCache current = new GUILayoutUtility.LayoutCache();
|
|
|
|
// Token: 0x04000797 RID: 1943
|
|
internal static readonly Rect kDummyRect = new Rect(0f, 0f, 1f, 1f);
|
|
|
|
// Token: 0x04000798 RID: 1944
|
|
private static GUIStyle s_SpaceStyle;
|
|
|
|
// Token: 0x02000270 RID: 624
|
|
internal sealed class LayoutCache
|
|
{
|
|
// Token: 0x06002A98 RID: 10904 RVA: 0x00037EF8 File Offset: 0x000360F8
|
|
internal LayoutCache()
|
|
{
|
|
this.layoutGroups.Push(this.topLevel);
|
|
}
|
|
|
|
// Token: 0x06002A99 RID: 10905 RVA: 0x00037F34 File Offset: 0x00036134
|
|
internal LayoutCache(GUILayoutUtility.LayoutCache other)
|
|
{
|
|
this.topLevel = other.topLevel;
|
|
this.layoutGroups = other.layoutGroups;
|
|
this.windows = other.windows;
|
|
}
|
|
|
|
// Token: 0x04000799 RID: 1945
|
|
internal GUILayoutGroup topLevel = new GUILayoutGroup();
|
|
|
|
// Token: 0x0400079A RID: 1946
|
|
internal GenericStack layoutGroups = new GenericStack();
|
|
|
|
// Token: 0x0400079B RID: 1947
|
|
internal GUILayoutGroup windows = new GUILayoutGroup();
|
|
}
|
|
}
|
|
}
|