Class UIElementsUtils
Provides methods for common operations performed on UIElements
Namespace: Unity.Play.Publisher.Editor
Syntax
public static class UIElementsUtils : object
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, Boolean, VisualElement, String, String, Boolean)
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? |
Boolean | 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 |
Boolean | 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 |