using HMUI; using SongBrowserPlugin.DataAccess; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; using VRUI; using Image = UnityEngine.UI.Image; namespace SongBrowserPlugin.UI { public static class UIBuilder { /// /// Create an empty BeatSaber VRUI view controller. /// /// /// /// public static T CreateViewController(string name) where T : VRUIViewController { T vc = new GameObject(name).AddComponent(); vc.rectTransform.anchorMin = new Vector2(0f, 0f); vc.rectTransform.anchorMax = new Vector2(1f, 1f); vc.rectTransform.sizeDelta = new Vector2(0f, 0f); vc.rectTransform.anchoredPosition = new Vector2(0f, 0f); return vc; } /// /// Create empty FlowCoordinator /// /// /// /// public static T CreateFlowCoordinator(string name) where T : FlowCoordinator { T vc = new GameObject(name).AddComponent(); return vc; } /// /// Helper, create a UI button from template name. /// /// /// /// static public Button CreateUIButton(RectTransform parent, String buttonTemplateName) { Button b = Resources.FindObjectsOfTypeAll