Esempio n. 1
0
 public override void OnDestroy()
 {
     foreach (SaberBurnDatum saberBurnDatum in _saberBurnData)
     {
         if (saberBurnDatum.lineRenderer)
         {
             Destroy(saberBurnDatum.lineRenderer.gameObject);
         }
         if (saberBurnDatum.renderTexture)
         {
             saberBurnDatum.renderTexture.Release();
             EssentialHelpers.SafeDestroy(saberBurnDatum.renderTexture);
         }
     }
 }
Esempio n. 2
0
        public void SetTimer(float currentTime, float totalTime)
        {
            timerText.text = EssentialHelpers.MinSecDurationText((int)(totalTime - currentTime));

            if (!_progressBarEnabled)
            {
                loadingProgressText.text = $"{currentTime.MinSecDurationText()} / {totalTime.MinSecDurationText()}";
                progressBarTop.rectTransform.sizeDelta = new Vector2(60f * (currentTime / totalTime), 6f);
            }

            if (totalTime - currentTime < 15f)
            {
                playNowButton.interactable = false;
            }
        }
Esempio n. 3
0
        public void SetSelectedSong(IBeatmapLevel level)
        {
            SetLoadingState(false);

            _selectedSong = level;

            _selectedSongCell.SetText(_selectedSong.songName + " <size=80%>" + _selectedSong.songSubName + "</size>");
            _selectedSongCell.SetSubText(_selectedSong.songAuthorName + " <size=80%>[" + _selectedSong.levelAuthorName + "]</size>");

            _playButton.SetButtonText("PLAY");
            _playBtnGlow.color = new Color(0f, 0.7058824f, 1f, 0.7843137f);

            _selectedSong.GetCoverImageTexture2DAsync(new CancellationToken()).ContinueWith((tex) => {
                if (!tex.IsFaulted)
                {
                    _selectedSongCell.SetIcon(tex.Result);
                }
            }).ConfigureAwait(false);

            _timeParamText.transform.parent.gameObject.SetActive(true);
            _bpmParamText.transform.parent.gameObject.SetActive(true);
            _blocksParamText.transform.parent.gameObject.SetActive(true);
            _obstaclesParamText.transform.parent.gameObject.SetActive(true);
            _starsParamText.transform.parent.gameObject.SetActive(true);
            _ratingParamText.transform.parent.gameObject.SetActive(true);

            _rankedText.gameObject.SetActive(true);
            _rankedText.alignment = TextAlignmentOptions.Center;

            _timeParamText.text = level.beatmapLevelData.audioClip != null?EssentialHelpers.MinSecDurationText(level.beatmapLevelData.audioClip.length) : "--";

            _bpmParamText.text       = level.beatsPerMinute.ToString();
            _blocksParamText.text    = "--";
            _obstaclesParamText.text = "--";
            _starsParamText.text     = "--";
            _ratingParamText.text    = "--";
            _rankedText.text         = "LOADING...";

            _characteristicControl.SetTexts(_selectedSong.beatmapCharacteristics.Distinct().Select(x => Localization.Get(x.characteristicNameLocalizationKey)).ToArray());

            int standardCharacteristicIndex = Array.FindIndex(_selectedSong.beatmapCharacteristics.Distinct().ToArray(), x => x.serializedName == "Standard");

            _characteristicControl.SelectCellWithNumber((standardCharacteristicIndex == -1 ? 0 : standardCharacteristicIndex));
            _characteristicControl_didSelectCellEvent((standardCharacteristicIndex == -1 ? 0 : standardCharacteristicIndex));
        }
Esempio n. 4
0
        public void SetSelectedSong(IPreviewBeatmapLevel level)
        {
            SetLoadingState(false);

            _selectedSong = null;

            _selectedSongCell.SetText(level.songName + " <size=80%>" + level.songSubName + "</size>");
            _selectedSongCell.SetSubText(level.songAuthorName + " <size=80%>[" + level.levelAuthorName + "]</size>");

            _playButton.SetButtonText("NOT BOUGHT");
            _playBtnGlow.color = Color.red;

            level.GetCoverImageTexture2DAsync(new CancellationToken()).ContinueWith((tex) => {
                if (!tex.IsFaulted)
                {
                    _selectedSongCell.SetIcon(tex.Result);
                }
            }).ConfigureAwait(false);

            _timeParamText.transform.parent.gameObject.SetActive(true);
            _bpmParamText.transform.parent.gameObject.SetActive(true);
            _blocksParamText.transform.parent.gameObject.SetActive(true);
            _obstaclesParamText.transform.parent.gameObject.SetActive(true);
            _starsParamText.transform.parent.gameObject.SetActive(true);
            _ratingParamText.transform.parent.gameObject.SetActive(true);

            _rankedText.gameObject.SetActive(true);
            _rankedText.alignment = TextAlignmentOptions.Center;

            _timeParamText.text      = EssentialHelpers.MinSecDurationText(level.songDuration);
            _bpmParamText.text       = level.beatsPerMinute.ToString();
            _blocksParamText.text    = "--";
            _obstaclesParamText.text = "--";
            _starsParamText.text     = "--";
            _ratingParamText.text    = "--";
            _rankedText.text         = "LOADING...";

            _characteristicControl.SetTexts(new string[] { "None" });
            _characteristicControl.SelectCellWithNumber(0);
            _difficultyControl.SetTexts(new string[] { "None" });
            _difficultyControl.SelectCellWithNumber(0);
        }
Esempio n. 5
0
        public void SetTimer(int time, bool results)
        {
            if (_timerText == null || _playNowButton == null)
            {
                return;
            }

            if (time != _lastTime)
            {
                if (results)
                {
                    _timerText.text = "RESULTS " + time.ToString();
                }
                else
                {
                    _timerText.text = EssentialHelpers.MinSecDurationText(time);
                }

                _playNowButton.interactable = time > 15f;
            }
            _lastTime = time;
        }
 public void SetTimer(int time)
 {
     timerText.text = EssentialHelpers.MinSecDurationText(time);
 }
Esempio n. 7
0
 public void SetSongDuration(float duration)
 {
     _timeParamText.text = EssentialHelpers.MinSecDurationText(duration);
 }