using System; using UnityEditor; using UnityEditor.UIElements; using UnityEngine; using UnityEngine.UIElements; using UnityObject = UnityEngine.Object; namespace Unity.Tutorials.Core.Editor { /// /// An utility class for common UIElements setup method /// internal static class UIElementsUtils { internal static readonly string s_UIResourcesPath = $"Packages/{FrameworkSettings.k_PackageName}/Editor/UI/"; /// /// Loads an asset from the common UI resource folder. /// /// type fo the file to load /// name of the file /// A reference to the loaded file internal static T LoadUIAsset(string filename) where T : UnityObject => AssetDatabase.LoadAssetAtPath($"{s_UIResourcesPath}/{filename}"); internal static Button SetupButton(string buttonName, Action onClickAction, bool isEnabled, VisualElement parent, string text = "", string tooltip = "", bool showIfEnabled = true, bool localize = false) { Button button = parent.Query