private IEnumerator UpdateSongText() { yield return(new WaitForSeconds(0.4f)); SpotifyLink.RequestUpdateTitle(); yield return(new WaitForSeconds(0.4f)); string spotifyText = SpotifyLink.GetCurrentlyPlayingSongTitle(); currSongText.SetText(spotifyText); if (spotifyText != _prevSpotifyState) { _prevSpotifyState = spotifyText; if (spotifyText != "N/A" && spotifyText != "Paused...") { _songTextScroller.Setup(); } else { _songTextScroller.Stop(); } } }
private void Start() { SpotifyLink.GetCurrentlyPlayingSongTitle(); LinkToSpotify(); StartCoroutine(UpdateInfoFast()); StartCoroutine(UpdateInfoMedium()); _wristOverlay.onInteractedWith += delegate(bool b) { //OverlayInteractionManager.I.TryEnableInteraction(b); }; _wristOverlay.onInitialized += ReloadTransform; _wristOverlay.onInteractedWith += OnInteractedWith; _wristOverlay.onOverlayTempHiding += OnLookShowing; _processorCount = SystemInfo.processorCount / 2; // setup the thread _cpuThread = new Thread(UpdateCPUUsage) { IsBackground = true, // we don't want that our measurement thread // steals performance Priority = System.Threading.ThreadPriority.BelowNormal }; // start the cpu usage thread //_cpuThread.Start(); }