Class UIElementsUtils
Provides methods for common operations performed on UIElements
Inherited Members
Namespace: Unity.Play.Publisher.Editor
Assembly: Unity.Play.Publisher.Editor.dll
Syntax
public static class UIElementsUtils
Methods
Hide(string, VisualElement)
Hides a visual element
Declaration
public static void Hide(string elementName, VisualElement parent)
Parameters
Type | Name | Description |
---|---|---|
string | elementName | The name of the element to hide |
VisualElement | parent | The parent VisualElement of the element to hide |
Hide(VisualElement)
Hides a visual element
Declaration
public static void Hide(VisualElement element)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | element | The element to hide |
RemoveStyleSheet(StyleSheet, VisualElement)
Removes a stylesheet from a visual element
Declaration
public static void RemoveStyleSheet(StyleSheet styleSheet, VisualElement target)
Parameters
Type | Name | Description |
---|---|---|
StyleSheet | styleSheet | The stylesheet to remove |
VisualElement | target | The target visual element |
SetupButton(string, Action, bool, VisualElement, string, string, bool)
Initializes the frontend and backend of a button
Declaration
public static void SetupButton(string buttonName, Action onClickAction, bool isEnabled, VisualElement parent, string text = "", string tooltip = "", bool showIfEnabled = true)
Parameters
Type | Name | Description |
---|---|---|
string | buttonName | The name of the button in the UXML file |
Action | onClickAction | What method will be called when the button is clicked? |
bool | isEnabled | Is this button enabled by default? |
VisualElement | parent | The parent VisualElement of the button |
string | text | The text the button will display |
string | tooltip | The tooltip the button will display when hovered |
bool | showIfEnabled | Should the button be shown when enabled? |
SetupLabel(string, string, VisualElement, Manipulator)
Initializes the frontend and backend of a label
Declaration
public static void SetupLabel(string labelName, string text, VisualElement parent, Manipulator manipulator = null)
Parameters
Type | Name | Description |
---|---|---|
string | labelName | The name of the label in the UXML file |
string | text | The text the label will display |
VisualElement | parent | The parent VisualElement of the label |
Manipulator | manipulator | A Manipulator implementation that defines custom interactions with this label |
Show(string, VisualElement)
Shows a hidden visual element
Declaration
public static void Show(string elementName, VisualElement parent)
Parameters
Type | Name | Description |
---|---|---|
string | elementName | The name of the element to show |
VisualElement | parent | The parent VisualElement of the element to show |
Show(VisualElement)
Shows a hidden visual element
Declaration
public static void Show(VisualElement element)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | element | The element to show |