private void initialiseStateManagers() { AudicaGameStateManager.scoreKeeper = UnityEngine.Object.FindObjectOfType <ScoreKeeper>(); AudicaGameStateManager.modifiers = UnityEngine.Object.FindObjectOfType <GameplayModifiers>(); AudicaGameStateManager.prefs = UnityEngine.Object.FindObjectOfType <PlayerPreferences>(); AudicaGameStateManager.config = UnityEngine.Object.FindObjectOfType <KataConfig>(); AudicaGameStateManager.songCues = UnityEngine.Object.FindObjectOfType <SongCues>(); }
private void pollSongState() { if (this.songPlaying) { string songClass = "custom"; if (this.songData.IsCoreSong()) { songClass = "ost"; } if (this.songData.dlc) { songClass = "dlc"; } if (this.songData.extrasSong) { songClass = "extras"; } // We don't want to calculate the ticks to the end of the song, it keeps playing! // Instead get the last target (plus its length) as the end ticks UnhollowerBaseLib.Il2CppReferenceArray <SongCues.Cue> cues = AudicaGameStateManager.songCues.mCues.cues; SongCues.Cue endCue = cues[cues.Length - 1]; float songEndTicks = endCue.tick + endCue.tickLength; float currentTick = AudicaGameStateManager.scoreKeeper.mLastTick; float totalTimeMs = this.songCalculator.SongLengthMilliseconds; float currentTimeMs = this.songCalculator.GetSongPositionMilliseconds(currentTick); float remainingTimeMs = totalTimeMs - currentTimeMs; this.songState.songId = this.songData.songID; this.songState.songName = this.songData.title; this.songState.songArtist = this.songData.artist; this.songState.songAuthor = this.songData.author; this.songState.difficulty = KataConfig.GetDifficultyName(AudicaGameStateManager.config.GetDifficulty()); this.songState.classification = songClass; this.songState.songLength = TimeSpan.FromMilliseconds(Convert.ToInt64(totalTimeMs)).ToString(); this.songState.timeElapsed = TimeSpan.FromMilliseconds(Convert.ToInt64(currentTimeMs)).ToString(); this.songState.timeRemaining = TimeSpan.FromMilliseconds(Convert.ToInt64(remainingTimeMs)).ToString(); this.songState.progress = currentTimeMs / totalTimeMs; this.songState.currentTick = currentTick; this.songState.ticksTotal = songEndTicks; this.songState.songSpeed = KataConfig.GetCueDartSpeedMultiplier(); // TODO: not a clue what this value actually is but it's not the speed multiplier! this.songState.health = AudicaGameStateManager.scoreKeeper.GetHealth(); this.songState.score = AudicaGameStateManager.scoreKeeper.mScore; this.songState.scoreMultiplier = AudicaGameStateManager.scoreKeeper.GetRawMultiplier(); this.songState.streak = AudicaGameStateManager.scoreKeeper.GetStreak(); this.songState.highScore = AudicaGameStateManager.scoreKeeper.GetHighScore(); this.songState.isNoFailMode = AudicaGameStateManager.prefs.NoFail.mVal; this.songState.isPracticeMode = AudicaGameStateManager.config.practiceMode; this.songState.isFullComboSoFar = AudicaGameStateManager.scoreKeeper.GetIsFullComboSoFar(); this.songState.modifiers = AudicaGameStateManager.modifiers.GetCurrentModifiers() .Select((GameplayModifiers.Modifier mod) => GameplayModifiers.GetModifierString(mod)) .ToList <string>(); } }
public static void Initialize() { PrepareOverlay(); GetReferences(); canvasScaler.scaleFactor = ScoreOverlayConfig.OverlayScale; FadeOutOverlay(); overlay.SetActive(false); bottomRight.gameObject.SetActive(false); topLeft.gameObject.SetActive(ScoreOverlayConfig.ShowModifiers); kataConfig = KataConfig.I; }