using SongBrowserPlugin.DataAccess; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TMPro; using UnityEngine; using UnityEngine.UI; using VRUI; namespace SongBrowserPlugin.UI { class PlaylistDetailViewController : VRUIViewController { private Playlist _selectedPlaylist; private TextMeshProUGUI _playlistTitleText; private TextMeshProUGUI _playlistAuthorText; private TextMeshProUGUI _playlistNumberOfSongs; private Button _selectButton; public Action didPressPlayPlaylist; public void Init(Playlist playlist) { _playlistTitleText = UIBuilder.CreateText(this.transform as RectTransform, playlist.playlistTitle, new Vector2(0, -20), new Vector2(60f, 10f) ); _playlistTitleText.alignment = TextAlignmentOptions.Center; _playlistAuthorText = UIBuilder.CreateText(this.transform as RectTransform, playlist.playlistAuthor, new Vector2(0, -30), new Vector2(60f, 10f) ); _playlistAuthorText.alignment = TextAlignmentOptions.Center; _playlistNumberOfSongs = UIBuilder.CreateText(this.transform as RectTransform, playlist.songs.Count.ToString(), new Vector2(0, -40), new Vector2(60f, 10f) ); _playlistNumberOfSongs.alignment = TextAlignmentOptions.Center; Button buttonTemplate = Resources.FindObjectsOfTypeAll