Class UIElementsUtils | WebGL Publisher | 4.1.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class UIElementsUtils

    Provides methods for common operations performed on UIElements

    Inheritance
    Object
    UIElementsUtils
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Play.Publisher.Editor
    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, 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

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023