219 lines
7.9 KiB
C#
219 lines
7.9 KiB
C#
using System;
|
|
|
|
namespace UnityEngine.Experimental.UIElements
|
|
{
|
|
// Token: 0x02000361 RID: 865
|
|
internal static class VisualTreeBuilderExtensions
|
|
{
|
|
// Token: 0x0600350D RID: 13581 RVA: 0x00056FF8 File Offset: 0x000551F8
|
|
public static IMBox Box(this VisualTreeBuilder cache, Rect position, GUIContent content, GUIStyle style)
|
|
{
|
|
IMBox imbox;
|
|
cache.NextElement<IMBox>(out imbox);
|
|
imbox.GenerateControlID();
|
|
imbox.position = position;
|
|
imbox.text = content.text;
|
|
imbox.style = style;
|
|
return imbox;
|
|
}
|
|
|
|
// Token: 0x0600350E RID: 13582 RVA: 0x00057038 File Offset: 0x00055238
|
|
public static IMButton Button(this VisualTreeBuilder cache, Rect position, GUIContent content, GUIStyle style)
|
|
{
|
|
IMButton imbutton;
|
|
cache.NextElement<IMButton>(out imbutton);
|
|
imbutton.GenerateControlID();
|
|
imbutton.position = position;
|
|
imbutton.text = content.text;
|
|
imbutton.style = style;
|
|
return imbutton;
|
|
}
|
|
|
|
// Token: 0x0600350F RID: 13583 RVA: 0x00057078 File Offset: 0x00055278
|
|
public static IMButtonGrid ButtonGrid(this VisualTreeBuilder cache, Rect position, int selected, GUIContent[] contents, int xCount, GUIStyle style, GUIStyle firstStyle, GUIStyle midStyle, GUIStyle lastStyle)
|
|
{
|
|
IMButtonGrid imbuttonGrid;
|
|
cache.NextElement<IMButtonGrid>(out imbuttonGrid);
|
|
imbuttonGrid.GenerateControlID();
|
|
imbuttonGrid.position = position;
|
|
imbuttonGrid.contents = contents;
|
|
imbuttonGrid.style = style;
|
|
imbuttonGrid.xCount = xCount;
|
|
imbuttonGrid.selected = selected;
|
|
imbuttonGrid.firstStyle = firstStyle;
|
|
imbuttonGrid.midStyle = midStyle;
|
|
imbuttonGrid.lastStyle = lastStyle;
|
|
return imbuttonGrid;
|
|
}
|
|
|
|
// Token: 0x06003510 RID: 13584 RVA: 0x000570DC File Offset: 0x000552DC
|
|
public static IMImage DrawTexture(this VisualTreeBuilder cache, Rect position, Texture image, ScaleMode scaleMode, bool alphaBlend, float imageAspect)
|
|
{
|
|
IMImage imimage;
|
|
cache.NextElement<IMImage>(out imimage);
|
|
imimage.position = position;
|
|
imimage.image = image;
|
|
imimage.scaleMode = scaleMode;
|
|
imimage.alphaBlend = alphaBlend;
|
|
imimage.imageAspect = imageAspect;
|
|
return imimage;
|
|
}
|
|
|
|
// Token: 0x06003511 RID: 13585 RVA: 0x00057120 File Offset: 0x00055320
|
|
public static IMGroup Group(this VisualTreeBuilder cache, Rect position, GUIContent content, GUIStyle style)
|
|
{
|
|
IMGroup imgroup;
|
|
cache.NextView<IMGroup>(out imgroup);
|
|
imgroup.GenerateControlID();
|
|
imgroup.position = position;
|
|
imgroup.text = content.text;
|
|
imgroup.style = style;
|
|
return imgroup;
|
|
}
|
|
|
|
// Token: 0x06003512 RID: 13586 RVA: 0x00057160 File Offset: 0x00055360
|
|
public static IMLabel Label(this VisualTreeBuilder cache, Rect position, GUIContent content, GUIStyle style)
|
|
{
|
|
IMLabel imlabel;
|
|
cache.NextElement<IMLabel>(out imlabel);
|
|
imlabel.position = position;
|
|
imlabel.text = content.text;
|
|
imlabel.style = style;
|
|
return imlabel;
|
|
}
|
|
|
|
// Token: 0x06003513 RID: 13587 RVA: 0x00057198 File Offset: 0x00055398
|
|
public static IMTextField PasswordField(this VisualTreeBuilder cache, Rect position, string passwordToShow, string password, char maskChar, int maxLength, GUIStyle style)
|
|
{
|
|
GUIContent guicontent = GUIContent.Temp(passwordToShow);
|
|
IMTextField imtextField;
|
|
if (TouchScreenKeyboard.isSupported)
|
|
{
|
|
imtextField = cache.TextField(position, GUIUtility.GetControlID(FocusType.Keyboard), guicontent, false, maxLength, style, password, maskChar);
|
|
}
|
|
else
|
|
{
|
|
imtextField = cache.TextField(position, GUIUtility.GetControlID(FocusType.Keyboard, position), guicontent, false, maxLength, style, password, maskChar);
|
|
}
|
|
return imtextField;
|
|
}
|
|
|
|
// Token: 0x06003514 RID: 13588 RVA: 0x000571F4 File Offset: 0x000553F4
|
|
public static IMRepeatButton RepeatButton(this VisualTreeBuilder cache, Rect position, GUIContent content, GUIStyle style, FocusType focusType)
|
|
{
|
|
IMRepeatButton imrepeatButton;
|
|
cache.NextElement<IMRepeatButton>(out imrepeatButton);
|
|
imrepeatButton.GenerateControlID();
|
|
imrepeatButton.position = position;
|
|
imrepeatButton.style = style;
|
|
imrepeatButton.text = content.text;
|
|
imrepeatButton.focusType = focusType;
|
|
return imrepeatButton;
|
|
}
|
|
|
|
// Token: 0x06003515 RID: 13589 RVA: 0x0005723C File Offset: 0x0005543C
|
|
public static IMSlider Slider(this VisualTreeBuilder cache, Rect position, float value, float size, float start, float end, GUIStyle sliderStyle, GUIStyle thumbStyle, bool horiz, int id)
|
|
{
|
|
IMSlider imslider;
|
|
cache.NextElement<IMSlider>(out imslider);
|
|
if (id != 0)
|
|
{
|
|
imslider.AssignControlID(id);
|
|
}
|
|
else
|
|
{
|
|
imslider.GenerateControlID();
|
|
}
|
|
imslider.SetProperties(position, value, size, start, end, sliderStyle, thumbStyle, horiz);
|
|
return imslider;
|
|
}
|
|
|
|
// Token: 0x06003516 RID: 13590 RVA: 0x0005728C File Offset: 0x0005548C
|
|
public static IMScrollView ScrollView(this VisualTreeBuilder cache, Rect position, Vector2 scrollPosition, Rect viewRect, bool alwaysShowHorizontal, bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, GUIStyle background)
|
|
{
|
|
IMScrollView imscrollView;
|
|
cache.NextView<IMScrollView>(out imscrollView);
|
|
imscrollView.GenerateControlID();
|
|
imscrollView.SetProperties(position, scrollPosition, viewRect, alwaysShowHorizontal, alwaysShowVertical, horizontalScrollbar, verticalScrollbar, background);
|
|
return imscrollView;
|
|
}
|
|
|
|
// Token: 0x06003517 RID: 13591 RVA: 0x000572C4 File Offset: 0x000554C4
|
|
public static IMScroller Scroller(this VisualTreeBuilder cache, Rect position, float value, float size, float leftValue, float rightValue, GUIStyle slider, GUIStyle thumb, GUIStyle leftButton, GUIStyle rightButton, bool horiz)
|
|
{
|
|
IMScroller imscroller;
|
|
cache.NextElement<IMScroller>(out imscroller);
|
|
imscroller.GenerateControlID();
|
|
imscroller.SetProperties(position, value, size, leftValue, rightValue, slider, thumb, leftButton, rightButton, horiz);
|
|
return imscroller;
|
|
}
|
|
|
|
// Token: 0x06003518 RID: 13592 RVA: 0x00057300 File Offset: 0x00055500
|
|
public static IMTextField TextField(this VisualTreeBuilder cache, Rect position, int id, GUIContent content, bool multiline, int maxLength, GUIStyle style, string secureText, char maskChar)
|
|
{
|
|
IMTextField imtextField;
|
|
if (TouchScreenKeyboard.isSupported)
|
|
{
|
|
IMTouchScreenTextField imtouchScreenTextField;
|
|
cache.NextElement<IMTouchScreenTextField>(out imtouchScreenTextField);
|
|
if (id != 0)
|
|
{
|
|
imtouchScreenTextField.AssignControlID(id);
|
|
}
|
|
else
|
|
{
|
|
imtouchScreenTextField.GenerateControlID();
|
|
}
|
|
imtouchScreenTextField.position = position;
|
|
imtouchScreenTextField.text = content.text;
|
|
imtouchScreenTextField.style = style;
|
|
imtouchScreenTextField.maxLength = maxLength;
|
|
imtouchScreenTextField.multiline = multiline;
|
|
imtouchScreenTextField.secureText = secureText;
|
|
imtouchScreenTextField.maskChar = maskChar;
|
|
imtextField = imtouchScreenTextField;
|
|
}
|
|
else
|
|
{
|
|
IMKeyboardTextField imkeyboardTextField;
|
|
cache.NextElement<IMKeyboardTextField>(out imkeyboardTextField);
|
|
if (id != 0)
|
|
{
|
|
imkeyboardTextField.AssignControlID(id);
|
|
}
|
|
else
|
|
{
|
|
imkeyboardTextField.GenerateControlID();
|
|
}
|
|
imkeyboardTextField.position = position;
|
|
imkeyboardTextField.text = content.text;
|
|
imkeyboardTextField.style = style;
|
|
imkeyboardTextField.maxLength = maxLength;
|
|
imkeyboardTextField.multiline = multiline;
|
|
imtextField = imkeyboardTextField;
|
|
}
|
|
return imtextField;
|
|
}
|
|
|
|
// Token: 0x06003519 RID: 13593 RVA: 0x000573D0 File Offset: 0x000555D0
|
|
public static IMToggle Toggle(this VisualTreeBuilder cache, Rect position, int id, bool value, GUIContent content, GUIStyle style)
|
|
{
|
|
IMToggle imtoggle;
|
|
cache.NextElement<IMToggle>(out imtoggle);
|
|
if (id != 0)
|
|
{
|
|
imtoggle.AssignControlID(id);
|
|
}
|
|
else
|
|
{
|
|
imtoggle.GenerateControlID();
|
|
}
|
|
imtoggle.position = position;
|
|
imtoggle.text = content.text;
|
|
imtoggle.style = style;
|
|
imtoggle.value = value;
|
|
return imtoggle;
|
|
}
|
|
}
|
|
}
|