public void Awake() { if (_playlistsNavigationController == null) { _playlistsNavigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>(); GameObject _playlistDetailGameObject = Instantiate(Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First(), _playlistsNavigationController.rectTransform, false).gameObject; _playlistDetailViewController = _playlistDetailGameObject.AddComponent <PlaylistDetailViewController>(); Destroy(_playlistDetailGameObject.GetComponent <StandardLevelDetailViewController>()); _playlistDetailViewController.name = "PlaylistDetailViewController"; } }
public void Awake() { if (_playlistsNavigationController == null && _playlistDetailViewController == null) { _playlistsNavigationController = BeatSaberUI.CreateViewController <BackButtonNavigationController>(); _playlistsNavigationController.didFinishEvent += _playlistsNavigationController_didFinishEvent; GameObject _playlistDetailGameObject = Instantiate(Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First(), _playlistsNavigationController.rectTransform, false).gameObject; _playlistDetailViewController = _playlistDetailGameObject.AddComponent <PlaylistDetailViewController>(); Destroy(_playlistDetailGameObject.GetComponent <StandardLevelDetailViewController>()); _playlistDetailViewController.name = "PlaylistDetailViewController"; _playlistDetailViewController.downloadButtonPressed += _playlistDetailViewController_downloadButtonPressed; _playlistDetailViewController.selectButtonPressed += _playlistDetailViewController_selectButtonPressed; _playlistDetailViewController.SetSelectButtonText("Select"); } }