This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,195 @@
using System;
namespace UnityEngine.Experimental.UIElements
{
// Token: 0x02000346 RID: 838
public class ScrollView : VisualContainer
{
// Token: 0x060033B4 RID: 13236 RVA: 0x000516DC File Offset: 0x0004F8DC
public ScrollView()
: this(ScrollView.kDefaultScrollerValues, ScrollView.kDefaultScrollerValues)
{
}
// Token: 0x060033B5 RID: 13237 RVA: 0x000516F0 File Offset: 0x0004F8F0
public ScrollView(Vector2 horizontalScrollerValues, Vector2 verticalScrollerValues)
{
this.horizontalScrollerValues = horizontalScrollerValues;
this.verticalScrollerValues = verticalScrollerValues;
this.contentView = new VisualContainer
{
name = "ContentView"
};
this.contentViewport = new VisualContainer
{
name = "ContentViewport"
};
this.contentViewport.clipChildren = true;
this.contentViewport.AddChild(this.contentView);
base.AddChild(this.contentViewport);
this.horizontalScroller = new Scroller(horizontalScrollerValues.x, horizontalScrollerValues.y, delegate(float value)
{
this.scrollOffset = new Vector2(value, this.scrollOffset.y);
}, Slider.Direction.Horizontal)
{
name = "HorizontalScroller"
};
base.AddChild(this.horizontalScroller);
this.verticalScroller = new Scroller(verticalScrollerValues.x, verticalScrollerValues.y, delegate(float value)
{
this.scrollOffset = new Vector2(this.scrollOffset.x, value);
}, Slider.Direction.Vertical)
{
name = "VerticalScroller"
};
base.AddChild(this.verticalScroller);
}
// Token: 0x17000BC0 RID: 3008
// (get) Token: 0x060033B6 RID: 13238 RVA: 0x000517EC File Offset: 0x0004F9EC
// (set) Token: 0x060033B7 RID: 13239 RVA: 0x00051808 File Offset: 0x0004FA08
public Vector2 horizontalScrollerValues { get; set; }
// Token: 0x17000BC1 RID: 3009
// (get) Token: 0x060033B8 RID: 13240 RVA: 0x00051814 File Offset: 0x0004FA14
// (set) Token: 0x060033B9 RID: 13241 RVA: 0x00051830 File Offset: 0x0004FA30
public Vector2 verticalScrollerValues { get; set; }
// Token: 0x17000BC2 RID: 3010
// (get) Token: 0x060033BA RID: 13242 RVA: 0x0005183C File Offset: 0x0004FA3C
// (set) Token: 0x060033BB RID: 13243 RVA: 0x00051858 File Offset: 0x0004FA58
public bool showHorizontal { get; set; }
// Token: 0x17000BC3 RID: 3011
// (get) Token: 0x060033BC RID: 13244 RVA: 0x00051864 File Offset: 0x0004FA64
// (set) Token: 0x060033BD RID: 13245 RVA: 0x00051880 File Offset: 0x0004FA80
public bool showVertical { get; set; }
// Token: 0x17000BC4 RID: 3012
// (get) Token: 0x060033BE RID: 13246 RVA: 0x0005188C File Offset: 0x0004FA8C
public bool needsHorizontal
{
get
{
return this.showHorizontal || this.contentView.position.width - base.position.width > 0f;
}
}
// Token: 0x17000BC5 RID: 3013
// (get) Token: 0x060033BF RID: 13247 RVA: 0x000518D8 File Offset: 0x0004FAD8
public bool needsVertical
{
get
{
return this.showVertical || this.contentView.position.height - base.position.height > 0f;
}
}
// Token: 0x17000BC6 RID: 3014
// (get) Token: 0x060033C0 RID: 13248 RVA: 0x00051924 File Offset: 0x0004FB24
// (set) Token: 0x060033C1 RID: 13249 RVA: 0x00051940 File Offset: 0x0004FB40
public Vector2 scrollOffset
{
get
{
return this.m_ScrollOffset;
}
set
{
this.m_ScrollOffset = value;
this.UpdateContentViewTransform();
}
}
// Token: 0x060033C2 RID: 13250 RVA: 0x00051950 File Offset: 0x0004FB50
private void UpdateContentViewTransform()
{
Vector2 scrollOffset = this.m_ScrollOffset;
scrollOffset.x -= this.horizontalScroller.lowValue;
scrollOffset.x /= this.horizontalScroller.highValue - this.horizontalScroller.lowValue;
scrollOffset.y -= this.verticalScroller.lowValue;
scrollOffset.y /= this.verticalScroller.highValue - this.verticalScroller.lowValue;
float num = this.contentView.position.width - this.contentViewport.position.width;
float num2 = this.contentView.position.height - this.contentViewport.position.height;
Matrix4x4 transform = this.contentView.transform;
transform.m03 = -(scrollOffset.x * num);
transform.m13 = -(scrollOffset.y * num2);
this.contentView.transform = transform;
base.Dirty(ChangeType.Repaint);
}
// Token: 0x17000BC7 RID: 3015
// (get) Token: 0x060033C3 RID: 13251 RVA: 0x00051A78 File Offset: 0x0004FC78
// (set) Token: 0x060033C4 RID: 13252 RVA: 0x00051A94 File Offset: 0x0004FC94
public VisualContainer contentView { get; private set; }
// Token: 0x17000BC8 RID: 3016
// (get) Token: 0x060033C5 RID: 13253 RVA: 0x00051AA0 File Offset: 0x0004FCA0
// (set) Token: 0x060033C6 RID: 13254 RVA: 0x00051ABC File Offset: 0x0004FCBC
public VisualContainer contentViewport { get; private set; }
// Token: 0x17000BC9 RID: 3017
// (get) Token: 0x060033C7 RID: 13255 RVA: 0x00051AC8 File Offset: 0x0004FCC8
// (set) Token: 0x060033C8 RID: 13256 RVA: 0x00051AE4 File Offset: 0x0004FCE4
public Scroller horizontalScroller { get; private set; }
// Token: 0x17000BCA RID: 3018
// (get) Token: 0x060033C9 RID: 13257 RVA: 0x00051AF0 File Offset: 0x0004FCF0
// (set) Token: 0x060033CA RID: 13258 RVA: 0x00051B0C File Offset: 0x0004FD0C
public Scroller verticalScroller { get; private set; }
// Token: 0x060033CB RID: 13259 RVA: 0x00051B18 File Offset: 0x0004FD18
protected internal override void OnPostLayout(bool hasNewLayout)
{
if (hasNewLayout)
{
if (this.contentView.position.width > Mathf.Epsilon)
{
this.horizontalScroller.Adjust(this.contentViewport.position.width / this.contentView.position.width);
}
if (this.contentView.position.height > Mathf.Epsilon)
{
this.verticalScroller.Adjust(this.contentViewport.position.height / this.contentView.position.height);
}
this.horizontalScroller.enabled = this.contentView.position.width - base.position.width > 0f;
this.verticalScroller.enabled = this.contentView.position.height - base.position.height > 0f;
this.horizontalScroller.visible = this.needsHorizontal;
this.verticalScroller.visible = this.needsVertical;
this.UpdateContentViewTransform();
}
}
// Token: 0x060033CC RID: 13260 RVA: 0x00051C68 File Offset: 0x0004FE68
public override EventPropagation HandleEvent(Event evt, VisualElement finalTarget)
{
EventType type = evt.type;
EventPropagation eventPropagation;
if (type != EventType.ScrollWheel)
{
eventPropagation = EventPropagation.Continue;
}
else
{
if (this.contentView.position.height - base.position.height > 0f)
{
if (evt.delta.y < 0f)
{
this.verticalScroller.ScrollPageUp();
}
else if (evt.delta.y > 0f)
{
this.verticalScroller.ScrollPageDown();
}
}
eventPropagation = EventPropagation.Stop;
}
return eventPropagation;
}
// Token: 0x04000AB7 RID: 2743
public static readonly Vector2 kDefaultScrollerValues = new Vector2(0f, 100f);
// Token: 0x04000ABA RID: 2746
private Vector2 m_ScrollOffset;
}
}