protected override void DidActivate(bool firstActivation, ActivationType activationType) { _logger = LogManager.GetCurrentClassLogger(); _logger.Debug("QueueController Activate."); _ui = TwitchIntegrationUi.Instance; _songListTableCellInstance = Resources.FindObjectsOfTypeAll <StandardLevelListTableCell>().First(x => (x.name == "SongListTableCell")); _queuedSongs = StaticData.QueueList.OfType <QueuedSong>().ToList(); _top5Queued = (List <QueuedSong>)_queuedSongs.Take(5); if (_titleText == null) { _titleText = _ui.CreateText(rectTransform, "REQUEST QUEUE", new Vector2(0f, -6f)); _titleText.alignment = TextAlignmentOptions.Top; _titleText.fontSize = 8; } if (_queuedSongsTableView == null) { _queuedSongsTableView = new GameObject().AddComponent <TableView>(); _queuedSongsTableView.transform.SetParent(rectTransform, false); _queuedSongsTableView.dataSource = this; ((RectTransform)_queuedSongsTableView.transform).anchorMin = new Vector2(0.3f, 0.5f); ((RectTransform)_queuedSongsTableView.transform).anchorMax = new Vector2(0.7f, 0.5f); ((RectTransform)_queuedSongsTableView.transform).sizeDelta = new Vector2(0f, 60f); ((RectTransform)_queuedSongsTableView.transform).anchoredPosition = new Vector3(0f, -3f); _queuedSongsTableView.didSelectRowEvent += _queuedSongsTableView_DidSelectRowEvent; } }
public void OnLevelWasLoaded(int level) { if (SceneManager.GetActiveScene().name != "Menu") { return; } TwitchIntegrationUi.OnLoad(); LevelRequestFlowCoordinator.OnLoad(SceneManager.GetActiveScene().name); }
public void Init(QueuedSong song) { var cell = GetComponent <StandardLevelListTableCell>(); foreach (var info in cell.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic)) { info.SetValue(this, info.GetValue(cell)); } Destroy(cell); _song = song; songName = _song.BeatName; author = _song.AuthName; StartCoroutine(TwitchIntegrationUi.LoadSprite(_song.CoverUrl, this)); }
private void SceneManager_activeSceneChanged(Scene from, Scene to) { Logger.Log($"Active scene changed from \"{from.name}\" to \"{to.name}\""); if (from.name == "EmptyTransition" && to.name.Contains("Menu")) { try { Logger.Log("Start Loading UI Objects"); RequestUIController.Instance.OnLoad(); TwitchIntegrationUi.OnLoad(); } catch (Exception e) { Logger.Exception("Exception on scene change: " + e); } } }