Class: DewGUI
- Namespace:
Global - Assembly:
Dew.Core.dll
public static class DewGUIFields
| Name | Declaration | Description |
|---|---|---|
fieldBuilders | public static List<(DewGUI.FieldBuilderCondition, DewGUI.FieldBuilder)> fieldBuilders | |
SupportedBasicTypes | public static readonly Type[] SupportedBasicTypes |
Properties
| Name | Declaration | Description |
|---|---|---|
canvasTransform | public static RectTransform canvasTransform { get; } | |
widgetBindItem | public static UI_BindItem widgetBindItem { get; } | |
widgetButton | public static Button widgetButton { get; } | |
widgetDropdown | public static TMP_Dropdown widgetDropdown { get; } | |
widgetInputField | public static TMP_InputField widgetInputField { get; } | |
widgetScrollRect | public static ScrollRect widgetScrollRect { get; } | |
widgetSlider | public static Slider widgetSlider { get; } | |
widgetTextBody | public static TextMeshProUGUI widgetTextBody { get; } | |
widgetTextHeader | public static TextMeshProUGUI widgetTextHeader { get; } | |
widgetTextLabel | public static TextMeshProUGUI widgetTextLabel { get; } | |
widgetToggleButton | public static UI_Toggle widgetToggleButton { get; } | |
widgetToggleCheck | public static UI_Toggle widgetToggleCheck { get; } | |
widgetWindow | public static UI_Window widgetWindow { get; } | The window comes with VerticalLayoutGroup and ContentSizeFitter, and is draggable by default. |
Methods
ApplyLayoutGroupDefaultSettings(HorizontalLayoutGroup, TextAnchor)
Helper for creating layout groups with nice default values.
public static void ApplyLayoutGroupDefaultSettings(HorizontalLayoutGroup group, TextAnchor alignment = TextAnchor.MiddleLeft)Parameters:
| Name | Type | Description |
|---|---|---|
group | UnityEngine.UI.HorizontalLayoutGroup | |
alignment | UnityEngine.TextAnchor |
ApplyLayoutGroupDefaultSettings(VerticalLayoutGroup, TextAnchor)
Helper for creating layout groups with nice default values.
public static void ApplyLayoutGroupDefaultSettings(VerticalLayoutGroup group, TextAnchor alignment = TextAnchor.UpperCenter)Parameters:
| Name | Type | Description |
|---|---|---|
group | UnityEngine.UI.VerticalLayoutGroup | |
alignment | UnityEngine.TextAnchor |
CreateHorizontalFlexibleSpace(Transform)
public static LayoutElement CreateHorizontalFlexibleSpace(Transform parent)Parameters:
| Name | Type | Description |
|---|---|---|
parent | UnityEngine.Transform |
Returns: UnityEngine.UI.LayoutElement
CreateHorizontalLayoutGroup(Transform, TextAnchor)
Helper for creating layout groups with nice default values.
public static HorizontalLayoutGroup CreateHorizontalLayoutGroup(Transform parent, TextAnchor alignment = TextAnchor.MiddleLeft)Parameters:
| Name | Type | Description |
|---|---|---|
parent | UnityEngine.Transform | |
alignment | UnityEngine.TextAnchor |
Returns: UnityEngine.UI.HorizontalLayoutGroup
CreateVerticalFlexibleSpace(Transform)
public static LayoutElement CreateVerticalFlexibleSpace(Transform parent)Parameters:
| Name | Type | Description |
|---|---|---|
parent | UnityEngine.Transform |
Returns: UnityEngine.UI.LayoutElement
CreateVerticalLayoutGroup(Transform, TextAnchor)
Helper for creating layout groups with nice default values.
public static VerticalLayoutGroup CreateVerticalLayoutGroup(Transform parent, TextAnchor alignment = TextAnchor.UpperCenter)Parameters:
| Name | Type | Description |
|---|---|---|
parent | UnityEngine.Transform | |
alignment | UnityEngine.TextAnchor |
Returns: UnityEngine.UI.VerticalLayoutGroup
CreateWidgetsForObject(Type, object, Transform, out SafeAction, out SafeAction)
Creates data-bound widgets for given object type.
public static void CreateWidgetsForObject(Type type, object state, Transform parent, out SafeAction onChanged, out SafeAction requestUpdate)Parameters:
| Name | Type | Description |
|---|---|---|
type | System.Type | |
state | object | |
parent | UnityEngine.Transform | |
onChanged | SafeAction | |
requestUpdate | SafeAction |
GenericInputFieldBuilder<T>(Transform, TryParseFunc<T>, CharacterValidation, out TMP_InputField)
public static FieldBuildResult GenericInputFieldBuilder<T>(Transform parent, DewGUI.TryParseFunc<T> tryParse, TMP_InputField.CharacterValidation validation, out TMP_InputField inputField)Parameters:
| Name | Type | Description |
|---|---|---|
parent | UnityEngine.Transform | |
tryParse | DewGUI.TryParseFunc<T> | |
validation | TMPro.TMP_InputField.TMPro.TMP_InputField.CharacterValidation | |
inputField | TMPro.TMP_InputField | |
| `` | T |
Returns: FieldBuildResult
SetExpandHeight(GameObject, bool)
public static GameObject SetExpandHeight(this GameObject c, bool expand)Parameters:
| Name | Type | Description |
|---|---|---|
c | UnityEngine.GameObject | |
expand | bool |
Returns: UnityEngine.GameObject
SetExpandHeight(GameObject, float)
public static GameObject SetExpandHeight(this GameObject c, float value)Parameters:
| Name | Type | Description |
|---|---|---|
c | UnityEngine.GameObject | |
value | float |
Returns: UnityEngine.GameObject
SetExpandHeight<T>(T, bool)
public static T SetExpandHeight<T>(this T c, bool expand) where T : ComponentParameters:
| Name | Type | Description |
|---|---|---|
c | T | |
expand | bool | |
| `` | T |
Returns: T
SetExpandHeight<T>(T, float)
public static T SetExpandHeight<T>(this T c, float value) where T : ComponentParameters:
| Name | Type | Description |
|---|---|---|
c | T | |
value | float | |
| `` | T |
Returns: T
SetExpandWidth(GameObject, bool)
public static GameObject SetExpandWidth(this GameObject c, bool expand)Parameters:
| Name | Type | Description |
|---|---|---|
c | UnityEngine.GameObject | |
expand | bool |
Returns: UnityEngine.GameObject
SetExpandWidth(GameObject, float)
public static GameObject SetExpandWidth(this GameObject c, float value)Parameters:
| Name | Type | Description |
|---|---|---|
c | UnityEngine.GameObject | |
value | float |
Returns: UnityEngine.GameObject
SetExpandWidth<T>(T, bool)
public static T SetExpandWidth<T>(this T c, bool expand) where T : ComponentParameters:
| Name | Type | Description |
|---|---|---|
c | T | |
expand | bool | |
| `` | T |
Returns: T
SetExpandWidth<T>(T, float)
public static T SetExpandWidth<T>(this T c, float value) where T : ComponentParameters:
| Name | Type | Description |
|---|---|---|
c | T | |
value | float | |
| `` | T |
Returns: T
SetHeight(GameObject, float)
public static GameObject SetHeight(this GameObject c, float height)Parameters:
| Name | Type | Description |
|---|---|---|
c | UnityEngine.GameObject | |
height | float |
Returns: UnityEngine.GameObject
SetHeight<T>(T, float)
public static T SetHeight<T>(this T c, float height) where T : ComponentParameters:
| Name | Type | Description |
|---|---|---|
c | T | |
height | float | |
| `` | T |
Returns: T
SetText(GameObject, string)
public static GameObject SetText(this GameObject c, string text)Parameters:
| Name | Type | Description |
|---|---|---|
c | UnityEngine.GameObject | |
text | string |
Returns: UnityEngine.GameObject
SetText<T>(T, string)
public static T SetText<T>(this T c, string text) where T : ComponentParameters:
| Name | Type | Description |
|---|---|---|
c | T | |
text | string | |
| `` | T |
Returns: T
SetTextLocalized(GameObject, string)
public static GameObject SetTextLocalized(this GameObject c, string key)Parameters:
| Name | Type | Description |
|---|---|---|
c | UnityEngine.GameObject | |
key | string |
Returns: UnityEngine.GameObject
SetTextLocalized<T>(T, string)
public static T SetTextLocalized<T>(this T c, string key) where T : ComponentParameters:
| Name | Type | Description |
|---|---|---|
c | T | |
key | string | |
| `` | T |
Returns: T
SetWidth(GameObject, float)
public static GameObject SetWidth(this GameObject c, float width)Parameters:
| Name | Type | Description |
|---|---|---|
c | UnityEngine.GameObject | |
width | float |
Returns: UnityEngine.GameObject
SetWidth<T>(T, float)
public static T SetWidth<T>(this T c, float width) where T : ComponentParameters:
| Name | Type | Description |
|---|---|---|
c | T | |
width | float | |
| `` | T |
Returns: T