Пример #1
0
        void SetTitle(VRUIViewController screen, string title)
        {
            var titleTransform = screen.transform.Find("Title");

            titleTransform.GetComponent <TextMeshProUGUI>().text = title;
            SetRectYPos(titleTransform.GetComponent <RectTransform>(), -2);
        }
 public void SetSelected(VRUIViewController selected, Action callback = null, bool immediate = false)
 {
     if (immediate)
     {
         if (HasSelected)
         {
             PopViewController(immediate: true);
         }
         PushViewController(selected, callback, true);
         HasSelected = true;
     }
     else
     {
         if (HasSelected)
         {
             PopViewController(() =>
             {
                 PushViewController(selected, callback, immediate);
                 HasSelected = true;
             }, immediate);
         }
         else
         {
             PushViewController(selected, callback, immediate);
             HasSelected = true;
         }
     }
 }
Пример #3
0
        private VRUIViewController PopViewControllerStack(ViewControllerPosition pos)
        {
            VRUIViewController viewController = _viewControllerStacks[pos].Last();

            _viewControllerStacks[pos].Remove(viewController);
            return(viewController);
        }
        private void MainMenuNavigated(MainMenuViewController sender, MainMenuViewController.MenuButton subMenuType)
        {
            VRUIViewController parent = parentViewController;

            DismissModalViewController(null, true);
            parent.gameObject.SetActive(false);
        }
Пример #5
0
        private void AddModMenuButton()
        {
            try
            {
                _rightScreen =
                    ReflectionUtil.GetPrivateField <VRUIViewController>(_mainMenuViewController,
                                                                        "_releaseInfoViewController");
                _rightPos = _rightScreen.gameObject.transform as RectTransform;
                var modMenuButton = CreateButton(_rightPos);
                SetButtonText(ref modMenuButton, "Mod Menu");
                SetButtonIcon(ref modMenuButton, Icons.First(x => x.name == "SettingsIcon"));

                if (modMenuButton == null)
                {
                    ModMenuPlugin.debugLogger.Exception("Mod menu button returned as null");
                    return;
                }

                // Change button text and add listener
                modMenuButton.onClick.AddListener(delegate
                {
                    try
                    {
                        ModMenuPlugin.debugLogger.Log("Mod menu pressed");
                        if (_modMenuController == null)
                        {
                            _modMenuController = CreateViewController <ModMenuMasterViewController>();
                        }
                        _rightScreen.PresentModalViewController(_modMenuController, null);
                        ModMenuPlugin.debugLogger.Log("Mod menu setup finished");
                        //DELETE POSSIBLE DIFFICULTY TEXT
                        var modlisttemp = GameObject.FindObjectOfType <ModsListViewController>();
                        if (modlisttemp != null)
                        {
                            var textmeshs = modlisttemp.gameObject.GetComponentsInChildren <TextMeshProUGUI>();


                            foreach (TextMeshProUGUI textmesh in textmeshs)
                            {
                                ModMenuPlugin.debugLogger.Log(textmesh.rectTransform.parent.gameObject.name);
                                if (textmesh.rectTransform.parent.name == "DifficultyTableCell(Clone)")
                                {
                                    DestroyImmediate(textmesh.rectTransform.parent.gameObject);
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        ModMenuPlugin.debugLogger.Exception(ex.StackTrace + ex.Message);
                    }
                });
            }

            catch (Exception ex)
            {
                ModMenuPlugin.debugLogger.Exception(ex.StackTrace + ex.Message);
            }
        }
 public static bool Prefix(VRUIViewController viewController)
 {
     if (DrinkWaterPanel.Instance.DisplayPanelNeeded)
     {
         DrinkWaterPanel.Instance.ShowDrinkWaterPanel(DrinkWaterPanel.DrinkWaterPanelMode.RESTART);
         return(false);
     }
     return(true);
 }
Пример #7
0
        void CleanScreen(VRUIViewController screen)
        {
            var container = screen.transform.Find("SettingsContainer");
            var tempList  = container.Cast <Transform>().ToList();

            foreach (var child in tempList)
            {
                DestroyImmediate(child.gameObject);
            }
        }
Пример #8
0
 public static void PushViewController(VRUIViewController viewController, bool immediately)
 {
     if (Instance == null)
     {
         return;
     }
     if (_modMenuMasterViewController == null)
     {
         return;
     }
     _modMenuMasterViewController.PushViewController(viewController, immediately);
 }
 private void ShowResults(VRUIViewController parentViewController)
 {
     if (_resultsFlowCoordinator == null)
     {
         _resultsFlowCoordinator = Resources.FindObjectsOfTypeAll <ResultsFlowCoordinator>().First();
     }
     _resultsFlowCoordinator.didFinishEvent += HandleResultsFlowCoordinatorDidFinish;
     _resultsFlowCoordinator.Present(parentViewController, StaticData.LastLevelCompletionResults, StaticData.LastLevelPlayed,
                                     GameplayOptions.defaultOptions, GameplayMode.SoloStandard);
     StaticData.LastLevelCompletionResults = null;
     StartCoroutine(WaitForResults());
 }
        //This essentially rebuilds the UI Hiearchy without using a unity scene.
        public IEnumerator WaitForMenu()
        {
            _logger.Debug("Starting wait");
            yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <MainMenuViewController>().Any()));

            _logger.Debug("Wait over~");


            VRUIViewController parent = FindObjectOfType <MainMenuViewController>();

            try
            {
                if (FindObjectOfType <SoloModeSelectionViewController>() != null)
                {
                    parent = FindObjectOfType <SoloModeSelectionViewController>();
                    _logger.Debug("Parent set");
                }
            }
            catch (Exception e)
            {
                _logger.Error(e);
            }

            if (StaticData.QueueList.Count > 0 && StaticData.TwitchMode)
            {
                try
                {
                    Present(parent, false);
                    // ReSharper disable once InvertIf
                    if (StaticData.LastLevelCompletionResults != null)
                    {
                        ShowResults(_levelRequestNavigationController);
                    }
                }
                catch (Exception ex)
                {
                    _logger.Error("Failed to find MainMenuViewController: " + ex);
                }
            }
            else
            {
                FindObjectOfType <StandardLevelSelectionFlowCoordinator>().Present(parent, FindObjectOfType <LevelCollectionsForGameplayModes>().GetLevels(GameplayMode.SoloStandard), GameplayMode.SoloStandard);
                // ReSharper disable once InvertIf
                if (StaticData.LastLevelCompletionResults != null)
                {
                    _logger.Debug("Presenting Results");
                    ShowResults(FindObjectOfType <StandardLevelSelectionNavigationController>());
                }
            }
        }
        void SetupTweakSettings()
        {
            var origianlSettingsObject = Resources.FindObjectsOfTypeAll <SettingsViewController>().FirstOrDefault();

            var settingsObject = Instantiate(origianlSettingsObject.gameObject, origianlSettingsObject.transform.parent);

            settingsObject.SetActive(false);
            settingsObject.name = "Keyboard Input Settings View Controller";

            var originalSettings = settingsObject.GetComponent <SettingsViewController>();

            settingsView = settingsObject.AddComponent <ConfigViewController>();
            DestroyImmediate(originalSettings);

            left  = CopyScreens(origianlSettingsObject, "Left Screen", _howToPlayViewController.transform.parent);
            right = CopyScreens(origianlSettingsObject, "Right Screen", _releaseInfoViewController.transform.parent);

            settingsView._leftSettings  = left;
            settingsView._rightSettings = right;

            CleanScreen(settingsView);
            CleanScreen(left);
            CleanScreen(right);

            SetTitle(settingsView, "Input Bindings");
            SetTitle(left, "");
            SetTitle(right, "Edit Binding");

            Transform mainContainer  = settingsObject.transform.Find("SettingsContainer");
            Transform leftContainer  = left.transform.Find("SettingsContainer");
            Transform rightContainer = right.transform.Find("SettingsContainer");

            SetRectYPos(mainContainer.GetComponent <RectTransform>(), 12);
            SetRectYPos(leftContainer.GetComponent <RectTransform>(), 12);
            SetRectYPos(rightContainer.GetComponent <RectTransform>(), 12);

            CopySwitchSettingsController <EnableToggleSettingsController>("Enabled", mainContainer);
            CopyListSettingsController <InputMethodSettingsController>("Input Mode", mainContainer);
            CopyListSettingsController <PressModeSettingsController>("Key Press Method", mainContainer);
            CopyListSettingsController <BindingEditorSelectorSettingsController>("Edit Binding", mainContainer);

            Transform menuParent = rightContainer;//sideMenuParentObject.transform;

            cntrlBtnSel = CopyListSettingsController <ControllerButtonSelectorController>("Map", menuParent, false);
            CopyListSettingsController <EmptyListSettingsController>("", menuParent); // spacer
            CopyListSettingsController <EmptyListSettingsController>("", menuParent); // spacer
            keybBtnSel = CopyListSettingsController <KeyboardButtonSelectorController>("to", menuParent, false);

            SetSelectedBinding(-1);
        }
        public void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene)
        {
            if (scene.buildIndex == 1)
            {
                _mainMenuViewController    = Resources.FindObjectsOfTypeAll <MainMenuViewController>().First();
                _howToPlayViewController   = ReflectionUtil.GetPrivateField <VRUIViewController>(_mainMenuViewController, "_howToPlayViewController");
                _releaseInfoViewController = ReflectionUtil.GetPrivateField <VRUIViewController>(_mainMenuViewController, "_releaseInfoViewController");

                SetupTweakSettings();

                // ~~not enough settings yet
                CreateKeyboardSettingsButton();
            }
        }
Пример #13
0
        void SetupTweakSettings()
        {
            var origianlSettingsObject = Resources.FindObjectsOfTypeAll <SettingsViewController>().FirstOrDefault();

            var tweakSettingsObject = Instantiate(origianlSettingsObject.gameObject, origianlSettingsObject.transform.parent);

            tweakSettingsObject.SetActive(false);
            tweakSettingsObject.name = "Tweak Settings View Controller";

            var originalSettings = tweakSettingsObject.GetComponent <SettingsViewController>();

            tweakSettings = tweakSettingsObject.AddComponent <TweakSettingsViewController>();
            DestroyImmediate(originalSettings);

            left  = CopyScreens(origianlSettingsObject, "Left Screen", _howToPlayViewController.transform.parent);
            right = CopyScreens(origianlSettingsObject, "Right Screen", _releaseInfoViewController.transform.parent);

            tweakSettings._leftSettings  = left;
            tweakSettings._rightSettings = right;

            CleanScreen(tweakSettings);
            CleanScreen(left);
            CleanScreen(right);

            SetTitle(tweakSettings, "TWEAKS");
            SetTitle(left, "TWEAKS");
            SetTitle(right, "TWEAKS");

            Transform mainContainer  = tweakSettingsObject.transform.Find("SettingsContainer");
            Transform leftContainer  = left.transform.Find("SettingsContainer");
            Transform rightContainer = right.transform.Find("SettingsContainer");

            SetRectYPos(mainContainer.GetComponent <RectTransform>(), 12);
            SetRectYPos(leftContainer.GetComponent <RectTransform>(), 12);
            SetRectYPos(rightContainer.GetComponent <RectTransform>(), 12);

            CopyListSettingsController <NoteHitVolumeSettingsController>("Note Hit Volume", mainContainer);
            CopyListSettingsController <NoteMissVolumeSettingsController>("Note Miss Volume", mainContainer);
            CopyListSettingsController <MenuBGVolumeSettingsController>("Menu BG Music Volume", mainContainer);

            CopySwitchSettingsController <MoveEnergyBarSettingsController>("Move Energy Bar", rightContainer);
            CopySwitchSettingsController <ShowClockSettingsController>("Show Clock", rightContainer);
            CopySwitchSettingsController <Use24hrClockSettingsController>("24hr Clock", rightContainer);

            if (CameraPlusInstalled)
            {
                CopySwitchSettingsController <CameraPlusThirdPersonSettingsController>("Third Person Camera", mainContainer);
            }
        }
Пример #14
0
        public void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene)
        {
            if (scene.buildIndex == 1)
            {
                _mainMenuViewController    = Resources.FindObjectsOfTypeAll <MainMenuViewController>().First();
                _howToPlayViewController   = ReflectionUtil.GetPrivateField <VRUIViewController>(_mainMenuViewController, "_howToPlayViewController");
                _releaseInfoViewController = ReflectionUtil.GetPrivateField <VRUIViewController>(_mainMenuViewController, "_releaseInfoViewController");

                if (warningPlugins.Count > 0)
                {
                    StartCoroutine(LoadWarning());
                }

                SetupTweakSettings();
                CreateTweakSettingsButton();
            }
        }
Пример #15
0
        IEnumerator WaitForMenu()
        {
            yield return(new WaitUntil(delegate() { return Resources.FindObjectsOfTypeAll <VRUIScreenSystem>().Any(); }));

            VRUIScreenSystem screenSystem = Resources.FindObjectsOfTypeAll <VRUIScreenSystem>().First();

            yield return(new WaitWhile(delegate() { Console.WriteLine("Waiting for mainScreen"); return screenSystem.mainScreen == null; }));

            yield return(new WaitWhile(delegate() { Console.WriteLine("Waiting for rootViewController"); return screenSystem.mainScreen.rootViewController == null; }));

            try
            {
                VRUIViewController root = screenSystem.mainScreen.rootViewController;

                List <VRUIViewController> children = new List <VRUIViewController>();

                children.Add(root);

                while (children.Last().childViewController != null)
                {
                    children.Add(children.Last().childViewController);
                }

                children.Reverse();
                children.Remove(root);
                children.ForEach(x => { Console.WriteLine($"Dismissing {x.name}..."); x.DismissModalViewController(null, true); });

                MultiplayerServerHubViewController hub   = ui.CreateViewController <MultiplayerServerHubViewController>();
                MultiplayerLobbyViewController     lobby = ui.CreateViewController <MultiplayerLobbyViewController>();

                bool serverClosed = (lastCommands != null) ? lastCommands.Any(x => x.commandType == ServerCommandType.Kicked && x.kickReason == "Server closed") : false;

                hub.doNotUpdate = !serverClosed;
                FindObjectOfType <MainMenuViewController>().PresentModalViewController(hub, null, true);
                if (!serverClosed)
                {
                    lobby.selectedServerIP   = lastServerIP;
                    lobby.selectedServerPort = lastServerPort;
                    hub.PresentModalViewController(lobby, null, true);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($"MENU EXCEPTION: {e}");
            }
        }
#pragma warning disable CS0618
        protected override void DidActivate(bool firstActivation, ActivationType activationType)
        { // thx Caeden
            if (firstActivation && activationType == ActivationType.AddedToHierarchy)
            {
                title = "Installed Mods";

                navigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>();
                navigationController.didFinishEvent += backButton_DidFinish;

                modList = BeatSaberUI.CreateViewController <ModListController>();
                modList.Init(this, PluginManager.AllPlugins.Select(p => p.Metadata).Concat(PluginManager.DisabledPlugins), PluginLoader.ignoredPlugins, PluginManager.Plugins);

                settings = SettingsViewController.Create();

                downloads = BeatSaberUI.CreateViewController <DownloadProgressViewController>();

                PushViewControllerToNavigationController(navigationController, modList);
            }

            ProvideInitialViewControllers(navigationController, settings, downloads);
        }
Пример #17
0
        private void AddCustomSaberButton()
        {
            _rightScreen = ReflectionUtil.GetPrivateField <VRUIViewController>(_mainMenuViewController, "_releaseInfoViewController");
            _rightPos    = _rightScreen.rectTransform;
            var customSaberButton = CreateButton(_rightPos);

            if (customSaberButton == null)
            {
                return;
            }

            SetButtonText(ref customSaberButton, "Saber Menu");
            customSaberButton.onClick.AddListener(delegate
            {
                if (_sabersMasterViewController == null)
                {
                    _sabersMasterViewController = CreateViewController <CustomSaberMasterViewController>();
                }

                _rightScreen.PresentModalViewController(_sabersMasterViewController, null);
            });
        }
Пример #18
0
        private void SetViewController(FlowCoordinator flowCoordinator, VRUIViewController viewController, ViewControllerPosition pos, bool immediate)
        {
            string method = string.Empty;

            switch (pos)
            {
            case ViewControllerPosition.Left:
                method = "SetLeftScreenViewController";
                break;

            case ViewControllerPosition.Right:
                method = "SetRightScreenViewController";
                break;

            case ViewControllerPosition.Bottom:
                method = "SetBottomScreenViewController";
                break;

            default:
                return;
            }
            flowCoordinator.InvokePrivateMethod(method, new object[] { viewController, immediate });
        }
        public static CustomSlider CreateUISlider(this VRUIViewController parent, float min, float max, float increment, bool intValues, UnityAction <float> onValueChanged = null)
        {
            CustomSlider scrollbar = BeatSaberUI.CreateUISlider(parent.rectTransform, min, max, increment, intValues, onValueChanged);

            return(scrollbar);
        }
Пример #20
0
        private void SetScreen(FlowCoordinator _activeFlowCoordinator, CustomViewController newViewController, VRUIViewController origViewController, ViewControllerPosition pos, bool immediately)
        {
            Action <bool> backAction = (immediate) => SetViewController(_activeFlowCoordinator, PopViewControllerStack(pos), pos, immediate);

            _dismissCustom += backAction;  // custom back button behavior
            if (!newViewController.isActivated)
            {
                if (!_viewControllerStacks.ContainsKey(pos))
                {
                    _viewControllerStacks[pos] = new List <VRUIViewController>();
                }

                _viewControllerStacks[pos].Add(origViewController);
                if (newViewController.includeBackButton)
                {
                    newViewController.ClearBackButtonCallbacks();
                    newViewController.backButtonPressed += () => { backAction.Invoke(false); }; // default back button behavior
                }
                SetViewController(_activeFlowCoordinator, newViewController, pos, immediately);
            }
        }
        public static Button CreateUIButton(this VRUIViewController parent, string buttonTemplate)
        {
            Button btn = BeatSaberUI.CreateUIButton(parent.rectTransform, buttonTemplate);

            return(btn);
        }
        public static GameObject CreateLoadingSpinner(this VRUIViewController parent)
        {
            GameObject loadingSpinner = BeatSaberUI.CreateLoadingSpinner(parent.rectTransform);

            return(loadingSpinner);
        }
        public static Button CreateUIButton(this VRUIViewController parent, string buttonTemplate, UnityAction onClick = null, string buttonText = "BUTTON", Sprite icon = null)
        {
            Button btn = BeatSaberUI.CreateUIButton(parent.rectTransform, buttonTemplate, onClick, buttonText, icon);

            return(btn);
        }
        public void Present(VRUIViewController parentViewController, bool fromDebug)
        {
            _ui     = TwitchIntegrationUi.Instance;
            _logger = LogManager.GetCurrentClassLogger();

            try
            {
                _menuSceneSetupData     = Resources.FindObjectsOfTypeAll <MenuSceneSetupData>().First();
                _mainGameSceneSetupData = Resources.FindObjectsOfTypeAll <MainGameSceneSetupData>().First();
                _resultsFlowCoordinator = Resources.FindObjectsOfTypeAll <ResultsFlowCoordinator>().First();

                if (_levelRequestNavigationController == null)
                {
                    _levelRequestNavigationController =
                        _ui.CreateViewController <LevelRequestNavigationController>("LevelRequestNavController");
                }

                if (_requestInfoViewController == null)
                {
                    _requestInfoViewController = _ui.CreateViewController <RequestInfoViewController>("RequestInfo");
                    _requestInfoViewController.rectTransform.anchorMin = new Vector2(0.3f, 0f);
                    _requestInfoViewController.rectTransform.anchorMax = new Vector2(0.7f, 1f);
                }

                _levelDifficultyViewController =
                    Resources.FindObjectsOfTypeAll <StandardLevelDifficultyViewController>().First();
                _levelDetailViewController =
                    Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First();
            }
            catch (Exception e)
            {
                _logger.Error("Unable to load UI components: " + e);
                return;
            }

            if (!_initialized)
            {
                DidFinishEvent += Finish;
                _levelRequestNavigationController.DidFinishEvent        += HandleLevelRequestNavigationControllerDidfinish;
                _levelDifficultyViewController.didSelectDifficultyEvent +=
                    HandleDifficultyViewControllerDidSelectDifficulty;
                _levelDetailViewController.didPressPlayButtonEvent += HandleDetailViewControllerDidPressPlayButton;



                _requestInfoViewController.DownloadButtonpressed += HandleDidPressDownloadButton;
                _requestInfoViewController.SkipButtonPressed     += HandleDidPressSkipButton;

                _initialized = true;
            }

            //_levelRequestNavigationController.Init();
            parentViewController.PresentModalViewController(_levelRequestNavigationController, null,
                                                            StaticData.DidStartFromQueue);
            _requestInfoViewController.Init("Default Song Name", "Default User");

            _levelRequestNavigationController.PushViewController(_requestInfoViewController, true);

            if (!fromDebug)
            {
                return;             //Loading song preview arrests control from the results controller, causing it to display improperly.
            }
            CheckQueueAndUpdate();
        }
        public static Button CreateBackButton(this VRUIViewController parent)
        {
            Button btn = BeatSaberUI.CreateBackButton(parent.rectTransform);

            return(btn);
        }
Пример #26
0
        private void AddModMenuButton()
        {
            try
            {
                _rightScreen =
                    ReflectionUtil.GetPrivateField <VRUIViewController>(_mainMenuViewController,
                                                                        "_releaseInfoViewController");
                _rightPos = _rightScreen.gameObject.transform as RectTransform;
                var modMenuButton = CreateButton(_rightPos);
                SetButtonText(ref modMenuButton, "Saber Menu");
                SetButtonIcon(ref modMenuButton, Icons.First(x => x.name == "SingleSaberIcon"));

                if (modMenuButton == null)
                {
                    return;
                }

                // Change button text and add listener
                modMenuButton.onClick.AddListener(delegate
                {
                    try
                    {
                        if (_modMenuController == null)
                        {
                            _modMenuController = CreateViewController <ModMenuMasterViewController>();
                        }
                        try
                        {
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.ToString());
                            throw;
                        }
                        _rightScreen.PresentModalViewController(_modMenuController, null);
                        //DELETE POSSIBLE DIFFICULTY TEXT
                        var modlisttemp = GameObject.FindObjectOfType <ModsListViewController>();
                        if (modlisttemp != null)
                        {
                            var textmeshs = modlisttemp.gameObject.GetComponentsInChildren <TextMeshProUGUI>();


                            foreach (TextMeshProUGUI textmesh in textmeshs)
                            {
                                if (textmesh.rectTransform.parent.name == "DifficultyTableCell(Clone)")
                                {
                                    DestroyImmediate(textmesh.rectTransform.parent.gameObject);
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                });
            }

            catch (Exception ex)
            {
            }
        }
 public void PushViewController(VRUIViewController controller, Action callback = null, bool immediate = false)
 {
     PushViewControllerToNavigationController(navigationController, controller, callback, immediate);
 }
Пример #28
0
        private void SetScreen(FlowCoordinator _activeFlowCoordinator, CustomViewController newViewController, VRUIViewController origViewController, bool right, bool immediately)
        {
            string        method     = right ? "SetRightScreenViewController" : "SetLeftScreenViewController";
            Action <bool> backAction = (immediate) => { _activeFlowCoordinator.InvokePrivateMethod(method, new object[] { PopViewControllerStack(right), immediate }); };

            _dismissCustom += backAction;  // custom back button behavior
            if (!newViewController.isActivated)
            {
                if (right)
                {
                    _rightViewControllerStack.Add(origViewController);
                }
                else
                {
                    _leftViewControllerStack.Add(origViewController);
                }

                if (newViewController.includeBackButton)
                {
                    newViewController.ClearBackButtonCallbacks();
                    newViewController.backButtonPressed += () => { backAction.Invoke(false); }; // default back button behavior
                }
                _activeFlowCoordinator.InvokePrivateMethod(method, new object[] { newViewController, immediately });
            }
        }
        public static ColorPicker CreateColorPicker(this VRUIViewController parent, Vector2 anchoredPosition, Vector2 sizeDelta)
        {
            ColorPicker colorPicker = BeatSaberUI.CreateColorPicker(parent.rectTransform, anchoredPosition, sizeDelta);

            return(colorPicker);
        }
        public static TextMeshProUGUI CreateText(this VRUIViewController parent, string text, Vector2 anchoredPosition)
        {
            TextMeshProUGUI textMesh = BeatSaberUI.CreateText(parent.rectTransform, text, anchoredPosition);

            return(textMesh);
        }