using System; using UnityEngine.UIElements; namespace Unity.Play.Publisher.Editor { /// /// Provides methods for common operations performed on UIElements /// public static class UIElementsUtils { /// /// Initializes the frontend and backend of a button /// /// The name of the button in the UXML file /// What method will be called when the button is clicked? /// Is this button enabled by default? /// The parent VisualElement of the button /// The text the button will display /// The tooltip the button will display when hovered /// Should the button be shown when enabled? public static void SetupButton(string buttonName, Action onClickAction, bool isEnabled, VisualElement parent, string text = "", string tooltip = "", bool showIfEnabled = true) { Button button = parent.Query