Files
2026-06-04 11:42:34 +02:00

221 lines
5.6 KiB
C#

using System;
namespace UnityEngine
{
// Token: 0x0200026B RID: 619
internal class GUILayoutEntry
{
// Token: 0x06002A55 RID: 10837 RVA: 0x00036430 File Offset: 0x00034630
public GUILayoutEntry(float _minWidth, float _maxWidth, float _minHeight, float _maxHeight, GUIStyle _style)
{
this.minWidth = _minWidth;
this.maxWidth = _maxWidth;
this.minHeight = _minHeight;
this.maxHeight = _maxHeight;
if (_style == null)
{
_style = GUIStyle.none;
}
this.style = _style;
}
// Token: 0x06002A56 RID: 10838 RVA: 0x000364A4 File Offset: 0x000346A4
public GUILayoutEntry(float _minWidth, float _maxWidth, float _minHeight, float _maxHeight, GUIStyle _style, GUILayoutOption[] options)
{
this.minWidth = _minWidth;
this.maxWidth = _maxWidth;
this.minHeight = _minHeight;
this.maxHeight = _maxHeight;
this.style = _style;
this.ApplyOptions(options);
}
// Token: 0x170009BB RID: 2491
// (get) Token: 0x06002A57 RID: 10839 RVA: 0x00036510 File Offset: 0x00034710
// (set) Token: 0x06002A58 RID: 10840 RVA: 0x0003652C File Offset: 0x0003472C
public GUIStyle style
{
get
{
return this.m_Style;
}
set
{
this.m_Style = value;
this.ApplyStyleSettings(value);
}
}
// Token: 0x170009BC RID: 2492
// (get) Token: 0x06002A59 RID: 10841 RVA: 0x00036540 File Offset: 0x00034740
public virtual RectOffset margin
{
get
{
return this.style.margin;
}
}
// Token: 0x06002A5A RID: 10842 RVA: 0x00036560 File Offset: 0x00034760
public virtual void CalcWidth()
{
}
// Token: 0x06002A5B RID: 10843 RVA: 0x00036564 File Offset: 0x00034764
public virtual void CalcHeight()
{
}
// Token: 0x06002A5C RID: 10844 RVA: 0x00036568 File Offset: 0x00034768
public virtual void SetHorizontal(float x, float width)
{
this.rect.x = x;
this.rect.width = width;
}
// Token: 0x06002A5D RID: 10845 RVA: 0x00036584 File Offset: 0x00034784
public virtual void SetVertical(float y, float height)
{
this.rect.y = y;
this.rect.height = height;
}
// Token: 0x06002A5E RID: 10846 RVA: 0x000365A0 File Offset: 0x000347A0
protected virtual void ApplyStyleSettings(GUIStyle style)
{
this.stretchWidth = ((style.fixedWidth != 0f || !style.stretchWidth) ? 0 : 1);
this.stretchHeight = ((style.fixedHeight != 0f || !style.stretchHeight) ? 0 : 1);
this.m_Style = style;
}
// Token: 0x06002A5F RID: 10847 RVA: 0x00036608 File Offset: 0x00034808
public virtual void ApplyOptions(GUILayoutOption[] options)
{
if (options != null)
{
foreach (GUILayoutOption guilayoutOption in options)
{
switch (guilayoutOption.type)
{
case GUILayoutOption.Type.fixedWidth:
this.minWidth = (this.maxWidth = (float)guilayoutOption.value);
this.stretchWidth = 0;
break;
case GUILayoutOption.Type.fixedHeight:
this.minHeight = (this.maxHeight = (float)guilayoutOption.value);
this.stretchHeight = 0;
break;
case GUILayoutOption.Type.minWidth:
this.minWidth = (float)guilayoutOption.value;
if (this.maxWidth < this.minWidth)
{
this.maxWidth = this.minWidth;
}
break;
case GUILayoutOption.Type.maxWidth:
this.maxWidth = (float)guilayoutOption.value;
if (this.minWidth > this.maxWidth)
{
this.minWidth = this.maxWidth;
}
this.stretchWidth = 0;
break;
case GUILayoutOption.Type.minHeight:
this.minHeight = (float)guilayoutOption.value;
if (this.maxHeight < this.minHeight)
{
this.maxHeight = this.minHeight;
}
break;
case GUILayoutOption.Type.maxHeight:
this.maxHeight = (float)guilayoutOption.value;
if (this.minHeight > this.maxHeight)
{
this.minHeight = this.maxHeight;
}
this.stretchHeight = 0;
break;
case GUILayoutOption.Type.stretchWidth:
this.stretchWidth = (int)guilayoutOption.value;
break;
case GUILayoutOption.Type.stretchHeight:
this.stretchHeight = (int)guilayoutOption.value;
break;
}
}
if (this.maxWidth != 0f && this.maxWidth < this.minWidth)
{
this.maxWidth = this.minWidth;
}
if (this.maxHeight != 0f && this.maxHeight < this.minHeight)
{
this.maxHeight = this.minHeight;
}
}
}
// Token: 0x06002A60 RID: 10848 RVA: 0x00036820 File Offset: 0x00034A20
public override string ToString()
{
string text = "";
for (int i = 0; i < GUILayoutEntry.indent; i++)
{
text += " ";
}
return string.Concat(new object[]
{
text,
UnityString.Format("{1}-{0} (x:{2}-{3}, y:{4}-{5})", new object[]
{
(this.style == null) ? "NULL" : this.style.name,
base.GetType(),
this.rect.x,
this.rect.xMax,
this.rect.y,
this.rect.yMax
}),
" - W: ",
this.minWidth,
"-",
this.maxWidth,
(this.stretchWidth == 0) ? "" : "+",
", H: ",
this.minHeight,
"-",
this.maxHeight,
(this.stretchHeight == 0) ? "" : "+"
});
}
// Token: 0x04000780 RID: 1920
public float minWidth;
// Token: 0x04000781 RID: 1921
public float maxWidth;
// Token: 0x04000782 RID: 1922
public float minHeight;
// Token: 0x04000783 RID: 1923
public float maxHeight;
// Token: 0x04000784 RID: 1924
public Rect rect = new Rect(0f, 0f, 0f, 0f);
// Token: 0x04000785 RID: 1925
public int stretchWidth;
// Token: 0x04000786 RID: 1926
public int stretchHeight;
// Token: 0x04000787 RID: 1927
private GUIStyle m_Style = GUIStyle.none;
// Token: 0x04000788 RID: 1928
internal static Rect kDummyRect = new Rect(0f, 0f, 1f, 1f);
// Token: 0x04000789 RID: 1929
protected static int indent = 0;
}
}