public void LateUpdate()
        {
            string sceneName = SceneManager.GetActiveScene().name;

            if (this.sceneChanged)
            {
                this.sceneChanged = false;
                if (sceneName == "Gameplay")
                {
                    gameManager = new GameManagerWrapper(GameObject.Find("Game Manager")?.GetComponent <GameManager>());
                    if (!gameManager.IsNull())
                    {
                        soloCounter  = gameManager.BasePlayers[0].SoloCounter;
                        scoreManager = gameManager.ScoreManager;
                    }
                    lastCombo = 0;
                }
            }
            if (sceneName == "Gameplay" && !gameManager.IsNull())
            {
                int currentCombo = scoreManager.OverallCombo;
                if (currentCombo > 0 && currentCombo != lastCombo && (currentCombo == 50 || currentCombo % 100 /*100*/ == 0))
                {
                    var textElement = new GameObject(string.Empty, new Type[] {
                        typeof(DancingText)
                    });
                    textElement.GetComponent <DancingText>().GameManager   = gameManager;
                    textElement.GetComponent <DancingText>().Text          = $"{currentCombo} Note Streak!";
                    textElement.GetComponent <DancingText>().Font          = uiFont;
                    textElement.GetComponent <DancingText>().RaisedForSolo = true;                    // Could be soloCounter.Bool2 but I want to gauge how people respond first.
                }
                lastCombo = currentCombo;
            }
            else if (sceneName == "Main Menu")
            {
                if (uiFont is null)
                {
                    //TODO: Get the font directly from the bundle?
                    uiFont = GameObject.Find("Profile Title").GetComponent <Text>().font;
                }
                if (!versionCheck.HasVersionBeenChecked)
                {
                    if (config.SilenceUpdates)
                    {
                        versionCheck.HasVersionBeenChecked = true;
                    }
                    else
                    {
                        string detectedVersion = GlobalVariablesWrapper.instance.buildVersion;
                        versionCheck.CheckVersion(detectedVersion);
                    }
                }
            }
        }
示例#2
0
        public void LateUpdate()
        {
            if (sceneChanged)
            {
                sceneChanged = false;
                if (isGameplay)
                {
                    var gameManager = GameManagerWrapper.Wrap(GameObject.Find("Game Manager").GetComponent <GameManager>());
                    if (!(isBot = gameManager.BasePlayers[0].Player.PlayerProfile.Bot.GetBoolValue))
                    {
                        var challengeFactory = new ChallengeFactory();
                        activeChallenge = challengeFactory.CreateChallenge(gameManager);
                        Logger.LogDebug(activeChallenge.ChallengeGoal);
                        healthContainer = gameManager.BasePlayers[0].HealthContainer;
                        healthContainer.CastToMonoBehaviour().gameObject.SetActive(true);
                        Logger.LogDebug("Updated!");

                        var clonedSPBar = Instantiate(GameObject.Find("SPBar"));
                        clonedSPBar.transform.localPosition = new Vector3(0.016f, 0.0f, 5.0f);
                        clonedSPBar.transform.localScale    = new Vector3(-1.0f, 1.0f, 1.0f);
                        clonedSPBar.transform.GetChild(0).GetComponent <SpriteRenderer>().enabled = false;
                        Destroy(clonedSPBar.transform.GetChild(4).gameObject);
                        clonedSPBar.transform.GetChild(6).GetComponent <SpriteRenderer>().color = new Color(1.0f, 0.5f, 0.6f);
                        clonedSPBar.transform.GetChild(7).GetComponent <SpriteRenderer>().color = new Color(1.0f, 0.5f, 0.6f);
                        spBar        = SPBarWrapper.Wrap(clonedSPBar.GetComponent <SPBar>());
                        challengeBar = ChallengeBar.InstantiatePrefab(GameObject.Find("SPBar").transform.parent);
                    }
                }
                else
                {
                    activeChallenge = null;
                }
            }
            if (isGameplay && hasSetupChallenge && !isBot)
            {
                activeChallenge.Update();
                //Logger.LogDebug($"Just before I run SetState, I have value {Mathf.Clamp(activeChallenge.PercentageToGold, 0.00001f, 1.0f)}, last {healthContainer.LastHealth}, RYT {healthContainer.RedYellowThreshold}, YGT {healthContainer.YellowGreenThreshold}");
                challengeBar.SetState(activeChallenge);
                healthContainer.SetState(activeChallenge.PercentageToGold);
                spBar.SetFill(activeChallenge.PercentageToBronze, false);
            }
        }
示例#3
0
        public void LateUpdate()
        {
            string sceneName = SceneManager.GetActiveScene().name;

            if (this.sceneChanged)
            {
                this.sceneChanged = false;
                if (sceneName == "Gameplay")
                {
                    gameManager = GameManagerWrapper.Wrap(GameObject.Find("Game Manager")?.GetComponent <GameManager>());
                    if (!gameManager.IsNull())
                    {
                        soloCounter  = gameManager.BasePlayers[0].SoloCounter;
                        scoreManager = gameManager.ScoreManager;
                    }
                    lastCombo        = 0;
                    detectedHotStart = false;
                    numPlayers       = 0;
                    for (int i = 0; i < 4; ++i)
                    {
                        numPlayers   += gameManager.BasePlayers[i].IsNull() ? 0 : 1;
                        starPowers[i] = 0.0f;
                    }
                }
            }
            if (sceneName == "Gameplay" && !gameManager.IsNull())
            {
                int currentCombo = scoreManager.OverallCombo;
                if (config.NoteStreakEnabled && currentCombo > 0 && currentCombo != lastCombo && (currentCombo == 50 || currentCombo % 100 == 0))
                {
                    CreateDancingText($"{currentCombo} Note Streak!");
                }
                if (!detectedHotStart && currentCombo == 25)
                {
                    if (config.HotStartEnabled)
                    {
                        bool allPlayersFC = true;
                        foreach (var player in gameManager.BasePlayers)
                        {
                            allPlayersFC &= player.IsNull() || !player.FirstNoteMissed;
                        }
                        if (allPlayersFC)
                        {
                            CreateDancingText($"Hot Start!");
                        }
                    }
                    detectedHotStart = true;
                }
                if (config.StarPowerActiveEnabled)
                {
                    for (int i = 0; i < 4; ++i)
                    {
                        var player = gameManager.BasePlayers[i];
                        if (!player.IsNull())
                        {
                            if (starPowers[i] < 0.5f && player.SPAmount >= 0.5f)
                            {
                                CreateDancingText(numPlayers > 1 ? $"{player.Player.PlayerProfile.PlayerName} Star Power Active!" : "Star Power Active!");
                            }
                            starPowers[i] = player.SPAmount;
                        }
                    }
                }
                lastCombo = currentCombo;
            }
            else if (sceneName == "Main Menu")
            {
                if (uiFont is null)
                {
                    //TODO: Get the font directly from the bundle?
                    uiFont = GameObject.Find("Profile Title").GetComponent <Text>().font;
                }
            }
            config.HandleInput();
        }
示例#4
0
        public void LateUpdate()
        {
            string sceneName = SceneManager.GetActiveScene().name;

            if (this.sceneChanged)
            {
                this.sceneChanged = false;
                if (sceneName == "Gameplay")
                {
                    // Song length
                    var gameManagerObject = GameObject.Find("Game Manager");
                    gameManager      = new GameManagerWrapper(gameManagerObject.GetComponent <GameManager>());
                    starProgress     = gameManager.StarProgress;
                    basePlayers      = gameManager.BasePlayers;
                    notes            = basePlayers[0].Notes;
                    totalNoteCount   = notes?.Count ?? 0;
                    totalStarPowers  = notes?.Count(n => n.IsStarPowerEnd) ?? 0;
                    hitNotes         = 0;
                    missedNotes      = 0;
                    currentCombo     = 0;
                    highestCombo     = 0;
                    currentNoteIndex = 0;

                    DestroyAndNullGameplayLabels();
                    Transform canvasTransform = FadeBehaviourWrapper.instance.fadeGraphic.canvas.transform;

                    TimeNameLabel           = CreateGameplayLabel(canvasTransform, "Extra Song UI Time Name Label", uiFont);
                    SongTimeLabel           = CreateGameplayLabel(canvasTransform, "Extra Song UI Song Time Label", uiFont);
                    SongLengthLabel         = CreateGameplayLabel(canvasTransform, "Extra Song UI Song Length Label", uiFont);
                    SongTimePercentageLabel = CreateGameplayLabel(canvasTransform, "Extra Song UI Song Time Percentage Label", uiFont);

                    CurrentStarProgressNameLabel       = CreateGameplayLabel(canvasTransform, "Extra Song UI Current Star Progress Name Label", uiFont);
                    CurrentStarProgressScoreLabel      = CreateGameplayLabel(canvasTransform, "Extra Song UI Current Star Progress Score Label", uiFont);
                    CurrentStarProgressEndScoreLabel   = CreateGameplayLabel(canvasTransform, "Extra Song UI Current Star Progress End Score Label", uiFont);
                    CurrentStarProgressPercentageLabel = CreateGameplayLabel(canvasTransform, "Extra Song UI Current Star Progress Percentage Label", uiFont);

                    SevenStarProgressNameLabel       = CreateGameplayLabel(canvasTransform, "Extra Song UI Seven Star Progress Name Label", uiFont);
                    SevenStarProgressScoreLabel      = CreateGameplayLabel(canvasTransform, "Extra Song UI Seven Star Progress Score Label", uiFont);
                    SevenStarProgressEndScoreLabel   = CreateGameplayLabel(canvasTransform, "Extra Song UI Seven Star Progress End Score Label", uiFont);
                    SevenStarProgressPercentageLabel = CreateGameplayLabel(canvasTransform, "Extra Song UI Seven Star Progress Percentage Label", uiFont);

                    NotesNameLabel              = CreateGameplayLabel(canvasTransform, "Extra Song UI Notes Name Label", uiFont);
                    NotesHitCounterLabel        = CreateGameplayLabel(canvasTransform, "Extra Song UI Notes Hit Counter Label", uiFont);
                    NotesPassedCounterLabel     = CreateGameplayLabel(canvasTransform, "Extra Song UI Notes Passed Counter Label", uiFont);
                    TotalNotesCounterLabel      = CreateGameplayLabel(canvasTransform, "Extra Song UI Total Notes Counter Label", uiFont);
                    SeenNotesHitPercentageLabel = CreateGameplayLabel(canvasTransform, "Extra Song UI Seen Notes Hit Percentage Label", uiFont);
                    NotesHitPercentageLabel     = CreateGameplayLabel(canvasTransform, "Extra Song UI Notes Hit Percentage Label", uiFont);
                    NotesMissedCounterLabel     = CreateGameplayLabel(canvasTransform, "Extra Song UI Notes Missed Counter Label", uiFont);

                    StarPowerNameLabel           = CreateGameplayLabel(canvasTransform, "Extra Song UI Star Power Name Label", uiFont);
                    StarPowersGottenCounterLabel = CreateGameplayLabel(canvasTransform, "Extra Song UI Star Powers Gotten Counter Label", uiFont);
                    TotalStarPowersCounterLabel  = CreateGameplayLabel(canvasTransform, "Extra Song UI Total Star Powers Counter Label", uiFont);
                    StarPowerPercentageLabel     = CreateGameplayLabel(canvasTransform, "Extra Song UI Star Power Percentage Label", uiFont);
                    CurrentStarPowerLabel        = CreateGameplayLabel(canvasTransform, "Extra Song UI Current Star Power Label", uiFont);

                    ComboNameLabel           = CreateGameplayLabel(canvasTransform, "Extra Song UI Combo Name Label", uiFont);
                    CurrentComboCounterLabel = CreateGameplayLabel(canvasTransform, "Extra Song UI Current Combo Counter Label", uiFont);
                    HighestComboCounterLabel = CreateGameplayLabel(canvasTransform, "Extra Song UI Highest Combo Counter Label", uiFont);
                }
                else
                {
                    DestroyAndNullGameplayLabels();
                }
            }
            if (sceneName == "Main Menu" && !versionCheck.HasVersionBeenChecked)
            {
                if (config.SilenceUpdates)
                {
                    versionCheck.HasVersionBeenChecked = true;
                }
                else
                {
                    string detectedVersion = GlobalVariablesWrapper.instance.buildVersion;
                    versionCheck.CheckVersion(detectedVersion);
                }
            }
            if (sceneName == "Gameplay" && !gameManager.IsNull() && gameManager.PracticeUI.practiceUI == null)
            {
                // Song length
                formattedSongTime   = string.Format(config.SongTime.Format, DoubleToTimeString(gameManager.SongTime));
                formattedSongLength = string.Format(config.SongLength.Format, DoubleToTimeString(gameManager.SongLength));
                songTimePercentage  = Math.Max(Math.Min(gameManager.SongTime * 100.0 / gameManager.SongLength, 100.0), 0.0);

                // Star progress
                currentStarCount    = starProgress.CurrentStar;
                currentScore        = Math.Min(starProgress.LastScore, starProgress.StarScores[6]);          //TODO: Migrate to ScoreManager 'cause this stops incremented after you reach 7-star.
                previousStarScore   = starProgress.CurrentStar == 0 ? 0 : starProgress.StarScores[starProgress.CurrentStar - 1];
                nextStarScore       = starProgress.StarScores[starProgress.CurrentStar];
                nextStarPercentage  = starProgress.CurrentStar < 7 ? (currentScore - previousStarScore) * 100.0 / (nextStarScore - previousStarScore) : 100.0;
                sevenStarScore      = starProgress.StarScores[6];
                sevenStarPercentage = Math.Min(currentScore * 100.0 / sevenStarScore, 100.0);

                // Note count
                while (currentNoteIndex < totalNoteCount && (notes[currentNoteIndex].WasHit || notes[currentNoteIndex].WasMissed))
                {
                    if (notes[currentNoteIndex].WasHit)
                    {
                        ++hitNotes;
                    }
                    else if (notes[currentNoteIndex].WasMissed)
                    {
                        ++missedNotes;
                    }
                    ++currentNoteIndex;
                }
                seenNotes           = hitNotes + missedNotes;
                hitNotesPercentage  = totalNoteCount == 0 ? 100.0 : hitNotes * 100.0 / totalNoteCount;
                seenNotesPercentage = seenNotes == 0 ? 100.0 : hitNotes * 100.0 / seenNotes;
                fcIndicator         = seenNotes == hitNotes ? (!gameManager.BasePlayers[0].FirstNoteMissed ? "FC" : "100%") : $"-{missedNotes}";

                starPowersGotten    = basePlayers[0].StarPowersHit;
                starPowerPercentage = totalStarPowers == 0 ? 100.0 : starPowersGotten * 100.0 / totalStarPowers;
                currentStarPower    = basePlayers[0].spBar.someFloat * 100.0;

                currentCombo = basePlayers[0].Combo;
                highestCombo = basePlayers[0].HighestCombo;

                UpdateGameplayLabel(TimeNameLabel, config.TimeName, config.TimeName.Format);
                UpdateGameplayLabel(SongTimeLabel, config.SongTime, formattedSongTime);
                UpdateGameplayLabel(SongLengthLabel, config.SongLength, formattedSongLength);
                UpdateGameplayLabel(SongTimePercentageLabel, config.SongTimePercentage, string.Format(config.SongTimePercentage.Format, songTimePercentage.ToString("0.00")));

                UpdateGameplayLabel(CurrentStarProgressNameLabel, config.CurrentStarProgressName, string.Format(config.CurrentStarProgressName.Format, currentStarCount, Math.Min(7, currentStarCount + 1)));
                UpdateGameplayLabel(CurrentStarProgressScoreLabel, config.CurrentStarProgressScore, string.Format(config.CurrentStarProgressScore.Format, currentScore - previousStarScore));
                UpdateGameplayLabel(CurrentStarProgressEndScoreLabel, config.CurrentStarProgressEndScore, string.Format(config.CurrentStarProgressEndScore.Format, nextStarScore - previousStarScore));
                UpdateGameplayLabel(CurrentStarProgressPercentageLabel, config.CurrentStarProgressPercentage, string.Format(config.CurrentStarProgressPercentage.Format, nextStarPercentage.ToString("0.00")));

                UpdateGameplayLabel(SevenStarProgressNameLabel, config.SevenStarProgressName, string.Format(config.SevenStarProgressName.Format, 0, 7));
                UpdateGameplayLabel(SevenStarProgressScoreLabel, config.SevenStarProgressScore, string.Format(config.SevenStarProgressScore.Format, currentScore));
                UpdateGameplayLabel(SevenStarProgressEndScoreLabel, config.SevenStarProgressEndScore, string.Format(config.SevenStarProgressEndScore.Format, sevenStarScore));
                UpdateGameplayLabel(SevenStarProgressPercentageLabel, config.SevenStarProgressPercentage, string.Format(config.SevenStarProgressPercentage.Format, sevenStarPercentage.ToString("0.00")));

                UpdateGameplayLabel(NotesNameLabel, config.NotesName, config.NotesName.Format);
                UpdateGameplayLabel(NotesHitCounterLabel, config.NotesHitCounter, string.Format(config.NotesHitCounter.Format, hitNotes));
                UpdateGameplayLabel(NotesPassedCounterLabel, config.NotesPassedCounter, string.Format(config.NotesPassedCounter.Format, seenNotes));
                UpdateGameplayLabel(TotalNotesCounterLabel, config.TotalNotesCounter, string.Format(config.TotalNotesCounter.Format, totalNoteCount));
                UpdateGameplayLabel(SeenNotesHitPercentageLabel, config.SeenNotesHitPercentage, string.Format(config.SeenNotesHitPercentage.Format, seenNotesPercentage.ToString("0.00")));
                UpdateGameplayLabel(NotesHitPercentageLabel, config.NotesHitPercentage, string.Format(config.NotesHitPercentage.Format, hitNotesPercentage.ToString("0.00")));
                UpdateGameplayLabel(NotesMissedCounterLabel, config.NotesMissedCounter, string.Format(config.NotesMissedCounter.Format, fcIndicator));

                UpdateGameplayLabel(StarPowerNameLabel, config.StarPowerName, config.StarPowerName.Format);
                UpdateGameplayLabel(StarPowersGottenCounterLabel, config.StarPowersGottenCounter, string.Format(config.StarPowersGottenCounter.Format, starPowersGotten));
                UpdateGameplayLabel(TotalStarPowersCounterLabel, config.TotalStarPowersCounter, string.Format(config.TotalStarPowersCounter.Format, totalStarPowers));
                UpdateGameplayLabel(StarPowerPercentageLabel, config.StarPowerPercentage, string.Format(config.StarPowerPercentage.Format, starPowerPercentage.ToString("0.00")));
                UpdateGameplayLabel(CurrentStarPowerLabel, config.CurrentStarPower, string.Format(config.CurrentStarPower.Format, currentStarPower.ToString("0.00")));

                UpdateGameplayLabel(ComboNameLabel, config.ComboName, config.ComboName.Format);
                UpdateGameplayLabel(CurrentComboCounterLabel, config.CurrentComboCounter, string.Format(config.CurrentComboCounter.Format, currentCombo));
                UpdateGameplayLabel(HighestComboCounterLabel, config.HighestComboCounter, string.Format(config.HighestComboCounter.Format, highestCombo));
            }
            if (uiFont is null && sceneName == "Main Menu")
            {
                //TODO: Get the font directly from the bundle?
                uiFont = GameObject.Find("Profile Title").GetComponent <Text>().font;
            }
            config.HandleInput();
        }
示例#5
0
        public void LateUpdate()
        {
            if (uiFont is null && SceneManager.GetActiveScene().name.Equals("Main Menu"))
            {
                uiFont = GameObject.Find("Profile Title").GetComponent <Text>().font;
            }
            if (sceneChanged)
            {
                sceneChanged = false;
                if (SceneManager.GetActiveScene().name.Equals("Gameplay"))
                {
                    var gameManagerObject = GameObject.Find("Game Manager");

                    gameManager = GameManagerWrapper.Wrap(GameObject.Find("Game Manager")?.GetComponent <GameManager>());
                    if (gameManager.GlobalVariables.SongEntry.SongEntry.lyrics && gameManager.GlobalVariables.SongEntry.SongEntry.chartPath.EndsWith("notes.mid"))
                    {
                        string     file   = gameManager.GlobalVariables.SongEntry.SongEntry.chartPath;
                        MidiParser parser = new MidiParser(file);

                        List <List <ChartCommand> > coms = parser.ParseMidi();
                        commands0 = coms[0];
                        commands1 = coms[1];
                        commands2 = coms[2];

                        Logger.LogDebug(commands2.Count);
                        foreach (ChartCommand com in commands2)
                        {
                            Logger.LogDebug($"{com.TimeInMs} {com.Command} {com.Parameter}");
                        }
                        index0 = 0;
                        index1 = 0;
                        index2 = 0;

                        //Logger.LogDebug(gameManager.GlobalVariables.SongEntry.SongEntry.chartPath);

                        lyricsTransform = GameObject.Find("Lyrics").transform;

                        altLyrics0 = CreateTmpText(lyricsTransform, "AltLyrics1", 3);
                        altLyrics1 = CreateTmpText(lyricsTransform, "AltLyrics2", 2);
                        altLyrics2 = CreateTmpText(lyricsTransform, "AltLyrics3", 1);

                        altLyrics0.fontSize = 44f;
                        altLyrics1.fontSize = 44f;
                        altLyrics2.fontSize = 44f;

                        altLyrics0.transform.localPosition = new Vector2(0, 460);
                        altLyrics1.transform.localPosition = new Vector2(0, 300);
                        altLyrics2.transform.localPosition = new Vector2(0, 240);
                        altLyrics0.horizontalAlignment     = HorizontalAlignmentOptions.Center;
                        altLyrics1.horizontalAlignment     = HorizontalAlignmentOptions.Center;
                        altLyrics2.horizontalAlignment     = HorizontalAlignmentOptions.Center;


                        altLyrics0.gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(Screen.width / 2, altLyrics0.preferredHeight);
                        altLyrics1.gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(Screen.width / 2, altLyrics1.preferredHeight);
                        altLyrics2.gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(Screen.width / 2, altLyrics2.preferredHeight);
                        indexes0 = new List <int>();
                        indexes1 = new List <int>();
                        indexes2 = new List <int>();
                        ClearLyric0();
                        ClearLyric1();
                        ClearLyric2();
                    }
                    else if (gameManager.GlobalVariables.SongEntry.SongEntry.lyrics && gameManager.GlobalVariables.SongEntry.SongEntry.chartPath.EndsWith("notes.chart"))
                    {
                        string       file   = gameManager.GlobalVariables.SongEntry.SongEntry.chartPath;
                        LyricsParser parser = new LyricsParser(file);

                        commands0 = parser.ParseLyrics()[0];
                        index0    = 0;

                        Logger.LogDebug(gameManager.GlobalVariables.SongEntry.SongEntry.chartPath);

                        lyricsTransform = GameObject.Find("Lyrics").transform;

                        altLyrics0          = CreateTmpText(lyricsTransform, "AltLyrics1", 1);
                        altLyrics0.fontSize = 44f;

                        altLyrics0.transform.localPosition = new Vector2(0, 460);
                        altLyrics0.horizontalAlignment     = HorizontalAlignmentOptions.Center;

                        altLyrics0.gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(Screen.width / 2, altLyrics0.preferredHeight);
                        indexes0 = new List <int>();

                        ClearLyric0();
                        ClearLyric1();
                        ClearLyric2();
                    }
                    else
                    {
                        commands0 = new List <ChartCommand>();
                    }
                    //UpdateTextButton(altLyrics, "TEST", 40, Color.white);
                }
            }
            if (SceneManager.GetActiveScene().name.Equals("Gameplay"))
            {
                if (index0 < commands0.Count)
                {
                    if (TimeSpan.FromSeconds(gameManager.SongTime).TotalMilliseconds >= commands0[index0].TimeInMs)
                    {
                        ChartCommand curCommand = commands0[index0++];

                        if (curCommand.Command == "phrase_start")
                        {
                            ClearLyric0();
                            int          i = 0;
                            ChartCommand x;
                            while ((index0 + i) < commands0.Count && (x = commands0[index0 + i++]).Command == "lyric")
                            {
                                altLyricText0 += x.Parameter;

                                if (altLyricText0.EndsWith("="))
                                {
                                    altLyricText0 = altLyricText0.TrimEnd('=') + "-";
                                }
                                else if (altLyricText0.EndsWith("$") || altLyricText0.EndsWith("#"))
                                {
                                    altLyricText0 = altLyricText0.TrimEnd(new char[] { '$', '#' });
                                }
                                else if (altLyricText0.EndsWith("-"))
                                {
                                    altLyricText0 = altLyricText0.TrimEnd('-');
                                }
                                else
                                {
                                    altLyricText0 += " ";
                                }
                                indexes0.Add(altLyricText0.Length);
                            }
                            altLyrics0.text = altLyricText0;
                        }
                        else if (curCommand.Command == "phrase_end")
                        {
                            ClearLyric0();
                        }
                        else
                        {
                            altLyrics0.text = "<color=#47a9ea>" + altLyricText0.Substring(0, indexes0[colorIndex0]) + "</color>" + altLyricText0.Substring(indexes0[colorIndex0++]);
                        }
                        //altLyrics.text = $"{curCommand.Command} {curCommand.Parameter}";
                    }
                }

                if (index1 < commands1.Count)
                {
                    if (TimeSpan.FromSeconds(gameManager.SongTime).TotalMilliseconds >= commands1[index1].TimeInMs)
                    {
                        ChartCommand curCommand = commands1[index1++];

                        if (curCommand.Command == "phrase_start")
                        {
                            ClearLyric1();
                            int          i = 0;
                            ChartCommand x;
                            while ((index1 + i) < commands1.Count && (x = commands1[index1 + i++]).Command == "lyric")
                            {
                                altLyricText1 += x.Parameter;

                                if (altLyricText1.EndsWith("="))
                                {
                                    altLyricText1 = altLyricText1.TrimEnd('=') + "-";
                                }
                                else if (altLyricText1.EndsWith("$") || altLyricText1.EndsWith("#"))
                                {
                                    altLyricText1 = altLyricText1.TrimEnd(new char[] { '$', '#' });
                                }
                                else if (altLyricText1.EndsWith("-"))
                                {
                                    altLyricText1 = altLyricText1.TrimEnd('-');
                                }
                                else
                                {
                                    altLyricText1 += " ";
                                }
                                indexes1.Add(altLyricText1.Length);
                            }
                            altLyrics1.text = altLyricText1;
                        }
                        else if (curCommand.Command == "phrase_end")
                        {
                            ClearLyric1();
                        }
                        else
                        {
                            altLyrics1.text = "<color=#e59b2b>" + altLyricText1.Substring(0, indexes1[colorIndex1]) + "</color>" + altLyricText1.Substring(indexes1[colorIndex1++]);
                        }
                        //altLyrics.text = $"{curCommand.Command} {curCommand.Parameter}";
                    }
                }
                if (index2 < commands2.Count)
                {
                    if (TimeSpan.FromSeconds(gameManager.SongTime).TotalMilliseconds >= commands2[index2].TimeInMs)
                    {
                        Logger.LogDebug("TEST0");
                        ChartCommand curCommand = commands2[index2++];

                        Logger.LogDebug("TEST1");
                        if (curCommand.Command == "phrase_start")
                        {
                            ClearLyric2();
                            int          i = 0;
                            ChartCommand x;
                            while ((index2 + i) < commands2.Count && (x = commands2[index2 + i++]).Command == "lyric")
                            {
                                Logger.LogDebug("TEST2");

                                altLyricText2 += x.Parameter;

                                if (altLyricText2.EndsWith("="))
                                {
                                    altLyricText2 = altLyricText2.TrimEnd('=') + "-";
                                }
                                else if (altLyricText2.EndsWith("$") || altLyricText2.EndsWith("#"))
                                {
                                    altLyricText2 = altLyricText2.TrimEnd(new char[] { '$', '#' });
                                }
                                else if (altLyricText2.EndsWith("-"))
                                {
                                    altLyricText2 = altLyricText2.TrimEnd('-');
                                }
                                else
                                {
                                    altLyricText2 += " ";
                                }
                                indexes2.Add(altLyricText2.Length);
                            }
                            altLyrics2.text = altLyricText2;
                        }
                        else if (curCommand.Command == "phrase_end")
                        {
                            ClearLyric2();
                        }
                        else
                        {
                            altLyrics2.text = "<color=#af3e1c>" + altLyricText2.Substring(0, indexes2[colorIndex2]) + "</color>" + altLyricText2.Substring(indexes2[colorIndex2++]);
                        }
                        //altLyrics.text = $"{curCommand.Command} {curCommand.Parameter}";
                    }
                }
            }
        }
        public void LateUpdate()
        {
            string sceneName = SceneManager.GetActiveScene().name;

            if (this.sceneChanged)
            {
                this.sceneChanged = false;
                if (sceneName == "Gameplay")
                {
                    int uiLayerMask       = LayerMask.NameToLayer("UI");
                    var gameManagerObject = GameObject.Find("Game Manager");
                    gameManager = new GameManagerWrapper(gameManagerObject.GetComponent <GameManager>());
                    basePlayers = gameManager.BasePlayers;
                    ResetGameplaySceneValues();

                    DestroyAndNullGameplayLabels();
                    Transform canvasTransform = FadeBehaviourWrapper.instance.fadeGraphic.canvas.transform;

                    accuracyIndicatorLabel = new GameObject($"Accuracy Indicator", new Type[] {
                        typeof(Text),
                        typeof(DestroyOnSceneChange)
                    });
                    accuracyIndicatorLabel.layer = uiLayerMask;
                    accuracyIndicatorLabel.transform.SetParent(canvasTransform);
                    accuracyIndicatorLabel.transform.SetSiblingIndex(0);
                    accuracyIndicatorLabel.transform.localEulerAngles = new Vector3();
                    accuracyIndicatorLabel.transform.localScale       = new Vector3(1.0f, 1.0f, 1.0f);
                    accuracyIndicatorLabel.GetComponent <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
                    accuracyIndicatorLabel.GetComponent <Text>().verticalOverflow   = VerticalWrapMode.Overflow;
                    accuracyIndicatorLabel.GetComponent <Text>().font = uiFont;

                    accuracyMessageLabel = new GameObject($"Accuracy Message", new Type[] {
                        typeof(Text),
                        typeof(DestroyOnSceneChange)
                    });
                    accuracyMessageLabel.layer = uiLayerMask;
                    accuracyMessageLabel.transform.SetParent(canvasTransform);
                    accuracyMessageLabel.transform.SetSiblingIndex(0);
                    accuracyMessageLabel.transform.localEulerAngles = new Vector3();
                    accuracyMessageLabel.transform.localScale       = new Vector3(1.0f, 1.0f, 1.0f);
                    accuracyMessageLabel.GetComponent <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
                    accuracyMessageLabel.GetComponent <Text>().verticalOverflow   = VerticalWrapMode.Overflow;
                    accuracyMessageLabel.GetComponent <Text>().font = uiFont;

                    averageAccuracyLabel = new GameObject($"Average Accuracy", new Type[] {
                        typeof(Text),
                        typeof(DestroyOnSceneChange)
                    });
                    averageAccuracyLabel.layer = uiLayerMask;
                    averageAccuracyLabel.transform.SetParent(canvasTransform);
                    averageAccuracyLabel.transform.SetSiblingIndex(0);
                    averageAccuracyLabel.transform.localEulerAngles = new Vector3();
                    averageAccuracyLabel.transform.localScale       = new Vector3(1.0f, 1.0f, 1.0f);
                    averageAccuracyLabel.GetComponent <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
                    averageAccuracyLabel.GetComponent <Text>().verticalOverflow   = VerticalWrapMode.Overflow;
                    averageAccuracyLabel.GetComponent <Text>().font = uiFont;
                }
                else
                {
                    DestroyAndNullGameplayLabels();
                }
                if (config.Enabled && sceneName == "EndOfSong")
                {
                    InstantiateEndOfSongLabels();
                }
            }
            if (sceneName == "Gameplay")
            {
                //! In practice mode, the song time is set to 1.5s before the section or A/B. If it is looping, it is
                //! initially set to 0, then to the appropriate time. As long as the user isn't on less than 10FPS, this should work.
                if (Math.Abs(gameManager.SongTime - lastSongTime) > 1.5 && gameManager.PracticeUI.practiceUI != null)
                {
                    ResetGameplaySceneValues();
                }
                UpdateGreatestThresholds();
                if (notes != null)
                {
                    UpdateNotes();
                }
                UpdateLabels();
            }
            else if (sceneName == "Main Menu")
            {
                if (uiFont is null)
                {
                    //TODO: Get the font directly from the bundle?
                    uiFont = GameObject.Find("Profile Title").GetComponent <Text>().font;
                }
                if (!versionCheck.HasVersionBeenChecked)
                {
                    if (config.SilenceUpdates)
                    {
                        versionCheck.HasVersionBeenChecked = true;
                    }
                    else
                    {
                        string detectedVersion = GlobalVariablesWrapper.instance.buildVersion;
                        versionCheck.CheckVersion(detectedVersion);
                    }
                }
            }
            config.HandleInput();
            if (!gameManager.IsNull())
            {
                lastSongTime = gameManager.SongTime;
            }
        }
示例#7
0
        public void LateUpdate()
        {
            string sceneName = SceneManager.GetActiveScene().name;

            if (this.sceneChanged)
            {
                this.sceneChanged = false;
                if (sceneName == "Gameplay")
                {
                    int uiLayerMask       = LayerMask.NameToLayer("UI");
                    var gameManagerObject = GameObject.Find("Game Manager");
                    gameManager = GameManagerWrapper.Wrap(gameManagerObject.GetComponent <GameManager>());
                    ResetGameplaySceneValues();

                    DestroyAndNullGameplayLabels();
                    Transform canvasTransform = FadeBehaviourWrapper.Instance.FadeGraphic.canvas.transform;

                    accuracyIndicatorLabel = new GameObject($"Accuracy Indicator", new Type[] {
                        typeof(Text),
                        typeof(DestroyOnSceneChange)
                    });
                    accuracyIndicatorLabel.layer = uiLayerMask;
                    accuracyIndicatorLabel.transform.SetParent(canvasTransform);
                    accuracyIndicatorLabel.transform.SetSiblingIndex(0);
                    accuracyIndicatorLabel.transform.localEulerAngles = new Vector3();
                    accuracyIndicatorLabel.transform.localScale       = new Vector3(1.0f, 1.0f, 1.0f);
                    accuracyIndicatorLabel.GetComponent <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
                    accuracyIndicatorLabel.GetComponent <Text>().verticalOverflow   = VerticalWrapMode.Overflow;
                    accuracyIndicatorLabel.GetComponent <Text>().font = BiendeoCHLib.BiendeoCHLib.Instance.CloneHeroDefaultFont;

                    accuracyMessageLabel = new GameObject($"Accuracy Message", new Type[] {
                        typeof(Text),
                        typeof(DestroyOnSceneChange)
                    });
                    accuracyMessageLabel.layer = uiLayerMask;
                    accuracyMessageLabel.transform.SetParent(canvasTransform);
                    accuracyMessageLabel.transform.SetSiblingIndex(0);
                    accuracyMessageLabel.transform.localEulerAngles = new Vector3();
                    accuracyMessageLabel.transform.localScale       = new Vector3(1.0f, 1.0f, 1.0f);
                    accuracyMessageLabel.GetComponent <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
                    accuracyMessageLabel.GetComponent <Text>().verticalOverflow   = VerticalWrapMode.Overflow;
                    accuracyMessageLabel.GetComponent <Text>().font = BiendeoCHLib.BiendeoCHLib.Instance.CloneHeroDefaultFont;

                    averageAccuracyLabel = new GameObject($"Average Accuracy", new Type[] {
                        typeof(Text),
                        typeof(DestroyOnSceneChange)
                    });
                    averageAccuracyLabel.layer = uiLayerMask;
                    averageAccuracyLabel.transform.SetParent(canvasTransform);
                    averageAccuracyLabel.transform.SetSiblingIndex(0);
                    averageAccuracyLabel.transform.localEulerAngles = new Vector3();
                    averageAccuracyLabel.transform.localScale       = new Vector3(1.0f, 1.0f, 1.0f);
                    averageAccuracyLabel.GetComponent <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
                    averageAccuracyLabel.GetComponent <Text>().verticalOverflow   = VerticalWrapMode.Overflow;
                    averageAccuracyLabel.GetComponent <Text>().font = BiendeoCHLib.BiendeoCHLib.Instance.CloneHeroDefaultFont;
                }
                else
                {
                    DestroyAndNullGameplayLabels();
                }
                if (config.Enabled && sceneName == "EndOfSong")
                {
                    InstantiateEndOfSongLabels();
                }
            }
            if (sceneName == "Gameplay")
            {
                //! In practice mode, the song time is set to 1.5s before the section or A/B. If it is looping, it is
                //! initially set to 0, then to the appropriate time. As long as the user isn't on less than 10FPS, this should work.
                if (Math.Abs(gameManager.SongTime - lastSongTime) > 1.5 && gameManager.PracticeUI.PracticeUI != null)
                {
                    ResetGameplaySceneValues();
                }
                UpdateGreatestThresholds();
                UpdateLabels();
            }
            config.HandleInput();
            if (!gameManager.IsNull())
            {
                lastSongTime = gameManager.SongTime;
            }
        }
示例#8
0
        public void LateUpdate()
        {
            string sceneName = SceneManager.GetActiveScene().name;

            if (this.sceneChanged)
            {
                this.sceneChanged = false;
                if (sceneName == "Gameplay")
                {
                    var gameManagerObject = GameObject.Find("Game Manager");
                    gameManager  = GameManagerWrapper.Wrap(gameManagerObject.GetComponent <GameManager>());
                    starProgress = gameManager.StarProgress;
                    basePlayers  = gameManager.BasePlayers;
                    songLength   = TimeSpan.FromSeconds(gameManager.SongLength);
                    numPlayers   = basePlayers.Count(bp => !bp.IsNull());
                    for (int i = bandIndex; i >= 0; --i)
                    {
                        if (i == bandIndex)
                        {
                            totalNoteCount[i]  = 0;
                            totalStarPowers[i] = 0;
                        }
                        else
                        {
                            var player = basePlayers[i];
                            if (!player.IsNull())
                            {
                                var notes = player.Notes;
                                totalNoteCount[bandIndex]  += (totalNoteCount[i] = notes.Count);
                                totalStarPowers[bandIndex] += (totalStarPowers[i] = notes.Count(n => n.IsStarPowerEnd));
                            }
                            else
                            {
                                totalNoteCount[i]      = 0;
                                hitNotesPercentage[i]  = 100.0;
                                seenNotesPercentage[i] = 100.0;
                                totalStarPowers[i]     = 0;
                            }
                        }
                        hitNotes[i]            = 0;
                        missedNotes[i]         = 0;
                        seenNotes[i]           = 0;
                        hitNotesPercentage[i]  = 0.00;
                        seenNotesPercentage[i] = 0.00;
                        fcIndicator[i]         = "FC";
                        starPowersGotten[i]    = 0;
                        starPowerPercentage[i] = 0.00;
                        currentStarPower[i]    = 0.00;
                        currentCombo[i]        = 0;
                        highestCombo[i]        = 0;
                    }

                    DestroyLabels();
                    Transform canvasTransform = FadeBehaviourWrapper.Instance.FadeGraphic.canvas.transform;

                    foreach (var label in config.Layout[numPlayers - 1])
                    {
                        CreateGameplayLabel(canvasTransform, label);
                    }
                }
                else
                {
                    DestroyLabels();
                }
            }
            if (sceneName == "Gameplay" && !gameManager.IsNull() && gameManager.PracticeUI.PracticeUI == null)
            {
                // Song length
                songTime           = TimeSpan.FromSeconds(Math.Max(Math.Min(gameManager.SongTime, gameManager.SongLength), 0.0));
                songTimePercentage = Math.Max(Math.Min(gameManager.SongTime * 100.0 / gameManager.SongLength, 100.0), 0.0);

                // Star progress
                currentStarCount    = starProgress.CurrentStar;
                currentScore        = Math.Min(starProgress.LastScore, starProgress.StarScores[6]);          //TODO: Migrate to ScoreManager 'cause this stops incremented after you reach 7-star.
                previousStarScore   = starProgress.CurrentStar == 0 ? 0 : starProgress.StarScores[starProgress.CurrentStar - 1];
                nextStarScore       = starProgress.StarScores[starProgress.CurrentStar];
                nextStarPercentage  = starProgress.CurrentStar < 7 ? (currentScore - previousStarScore) * 100.0 / (nextStarScore - previousStarScore) : 100.0;
                sevenStarScore      = starProgress.StarScores[6];
                sevenStarPercentage = Math.Min(currentScore * 100.0 / sevenStarScore, 100.0);

                currentStarPower[bandIndex] = 0.0;
                for (int i = 0; i < bandIndex; ++i)
                {
                    var player = basePlayers[i];
                    if (!player.IsNull())
                    {
                        currentStarPower[i]          = player.SPBar.LastFillAmount * 100.0;
                        currentStarPower[bandIndex] += currentStarPower[i];
                    }
                }

                foreach (var label in labels)
                {
                    UpdateGameplayLabel(label.Item1, label.Item2, label.Item3);
                }
            }
            config.HandleInput();
        }
        public void LateUpdate()
        {
            string sceneName = SceneManager.GetActiveScene().name;

            if (this.sceneChanged)
            {
                this.sceneChanged = false;
                if (sceneName == "Gameplay")
                {
                    int uiLayerMask       = LayerMask.NameToLayer("UI");
                    var gameManagerObject = GameObject.Find("Game Manager");
                    gameManager = new GameManagerWrapper(gameManagerObject.GetComponent <GameManager>());
                    ResetGameplaySceneValues();

                    DestroyAndNullGameplayLabels();
                    Transform canvasTransform = FadeBehaviourWrapper.instance.fadeGraphic.canvas.transform;

                    displayImageLabel = new GameObject($"Perfect Mode Indicator", new Type[] {
                        typeof(Text)
                    });
                    displayImageLabel.layer = uiLayerMask;
                    displayImageLabel.transform.SetParent(canvasTransform);
                    displayImageLabel.transform.SetSiblingIndex(0);
                    displayImageLabel.transform.localEulerAngles = new Vector3();
                    displayImageLabel.transform.localScale       = new Vector3(1.0f, 1.0f, 1.0f);
                    displayImageLabel.GetComponent <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
                    displayImageLabel.GetComponent <Text>().verticalOverflow   = VerticalWrapMode.Overflow;
                    displayImageLabel.GetComponent <Text>().font = uiFont;

                    remainingNotesLeftLabel = new GameObject($"Perfect Mode Notes Remaining", new Type[] {
                        typeof(Text)
                    });
                    remainingNotesLeftLabel.layer = uiLayerMask;
                    remainingNotesLeftLabel.transform.SetParent(canvasTransform);
                    remainingNotesLeftLabel.transform.SetSiblingIndex(0);
                    remainingNotesLeftLabel.transform.localEulerAngles = new Vector3();
                    remainingNotesLeftLabel.transform.localScale       = new Vector3(1.0f, 1.0f, 1.0f);
                    remainingNotesLeftLabel.GetComponent <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
                    remainingNotesLeftLabel.GetComponent <Text>().verticalOverflow   = VerticalWrapMode.Overflow;
                    remainingNotesLeftLabel.GetComponent <Text>().font = uiFont;

                    restartIndicatorLabel = new GameObject($"Perfect Mode Restart Message", new Type[] {
                        typeof(Text)
                    });
                    restartIndicatorLabel.layer = uiLayerMask;
                    restartIndicatorLabel.transform.SetParent(canvasTransform);
                    restartIndicatorLabel.transform.SetSiblingIndex(0);
                    restartIndicatorLabel.transform.localEulerAngles = new Vector3();
                    restartIndicatorLabel.transform.localScale       = new Vector3(1.0f, 1.0f, 1.0f);
                    restartIndicatorLabel.GetComponent <Text>().horizontalOverflow = HorizontalWrapMode.Overflow;
                    restartIndicatorLabel.GetComponent <Text>().verticalOverflow   = VerticalWrapMode.Overflow;
                    restartIndicatorLabel.GetComponent <Text>().font = uiFont;
                }
                else
                {
                    DestroyAndNullGameplayLabels();
                }
            }
            if (sceneName == "Main Menu" && !versionCheck.HasVersionBeenChecked)
            {
                if (config.SilenceUpdates)
                {
                    versionCheck.HasVersionBeenChecked = true;
                }
                else
                {
                    string detectedVersion = GlobalVariablesWrapper.instance.buildVersion;
                    versionCheck.CheckVersion(detectedVersion);
                }
            }
            if (config.Enabled && sceneName == "Gameplay" && !gameManager.IsNull())
            {
                target    = config.FC ? "FC" : (config.NotesMissed == 0 ? "100%" : $"-{config.NotesMissed}");
                isStillFC = !gameManager.BasePlayers[0].FirstNoteMissed;
                while (currentNoteIndex < totalNoteCount && (notes[currentNoteIndex].WasHit || notes[currentNoteIndex].WasMissed))
                {
                    if (!notes[currentNoteIndex].WasHit && notes[currentNoteIndex].WasMissed)
                    {
                        ++missedNotes;
                    }
                    ++currentNoteIndex;
                }
                if (!failedObjective && (config.FC && !isStillFC || config.NotesMissed < missedNotes))
                {
                    failedObjective            = true;
                    remainingTimeBeforeRestart = Math.Min(config.FailDelay, (float)(gameManager.SongLength - gameManager.SongTime));
                }
                if (failedObjective && (gameManager.PauseMenu is null || !gameManager.PauseMenu.activeInHierarchy))
                {
                    remainingTimeBeforeRestart -= Time.deltaTime;
                    if (remainingTimeBeforeRestart < 0.0f && !invokedSceneChange)
                    {
                        //TODO: Double-check that multiplayer works fine with this.
                        StartCoroutine(FadeBehaviourWrapper.instance.InvokeSceneChange("Gameplay"));
                        invokedSceneChange = true;
                    }
                }

                if (config.DisplayImage.Visible || config.LayoutTest)
                {
                    displayImageLabel.transform.localPosition = new Vector3(config.DisplayImage.X - Screen.width / 2, Screen.height / 2 - config.DisplayImage.Y);
                    var text = displayImageLabel.GetComponent <Text>();
                    text.enabled   = true;
                    text.fontSize  = config.DisplayImage.Size;
                    text.alignment = config.DisplayImage.Alignment;
                    text.fontStyle = (config.DisplayImage.Bold ? FontStyle.Bold : FontStyle.Normal) | (config.DisplayImage.Italic ? FontStyle.Italic : FontStyle.Normal);
                    text.text      = $"{target} mode active";
                    text.color     = config.DisplayImage.Color.Color;
                }
                else
                {
                    displayImageLabel.GetComponent <Text>().enabled = false;
                }

                if ((config.RemainingNotesLeft.Visible && !config.FC) || config.LayoutTest)
                {
                    remainingNotesLeftLabel.transform.localPosition = new Vector3(config.RemainingNotesLeft.X - Screen.width / 2, Screen.height / 2 - config.RemainingNotesLeft.Y);
                    var text = remainingNotesLeftLabel.GetComponent <Text>();
                    text.enabled   = true;
                    text.fontSize  = config.RemainingNotesLeft.Size;
                    text.alignment = config.RemainingNotesLeft.Alignment;
                    text.fontStyle = (config.RemainingNotesLeft.Bold ? FontStyle.Bold : FontStyle.Normal) | (config.RemainingNotesLeft.Italic ? FontStyle.Italic : FontStyle.Normal);
                    text.text      = config.NotesMissed - missedNotes >= 0 ? $"{config.NotesMissed - missedNotes} note{(config.NotesMissed - missedNotes == 1 ? string.Empty : "s")} can be missed" : $"Too many notes missed";
                    text.color     = config.RemainingNotesLeft.Color.Color;
                }
                else
                {
                    remainingNotesLeftLabel.GetComponent <Text>().enabled = false;
                }

                if ((config.RestartIndicator.Visible && failedObjective) || config.LayoutTest)
                {
                    restartIndicatorLabel.transform.localPosition = new Vector3(config.RestartIndicator.X - Screen.width / 2, Screen.height / 2 - config.RestartIndicator.Y);
                    var text = restartIndicatorLabel.GetComponent <Text>();
                    text.enabled   = true;
                    text.fontSize  = config.RestartIndicator.Size;
                    text.alignment = config.RestartIndicator.Alignment;
                    text.fontStyle = (config.RestartIndicator.Bold ? FontStyle.Bold : FontStyle.Normal) | (config.RestartIndicator.Italic ? FontStyle.Italic : FontStyle.Normal);
                    text.text      = $"{target} failed, restarting in {(int)remainingTimeBeforeRestart + 1}";
                    text.color     = new Color(config.RestartIndicator.Color.Color.r, config.RestartIndicator.Color.Color.g, config.RestartIndicator.Color.Color.b, config.RestartIndicator.Color.Color.a * Math.Min((config.FailDelay - remainingTimeBeforeRestart) * 2.0f, 1.0f));
                }
                else
                {
                    restartIndicatorLabel.GetComponent <Text>().enabled = false;
                }
            }
            else if (sceneName == "Gameplay")
            {
                displayImageLabel.GetComponent <Text>().enabled       = false;
                remainingNotesLeftLabel.GetComponent <Text>().enabled = false;
                restartIndicatorLabel.GetComponent <Text>().enabled   = false;
            }
            if (uiFont is null && sceneName == "Main Menu")
            {
                //TODO: Get the font directly from the bundle?
                uiFont = GameObject.Find("Profile Title").GetComponent <Text>().font;
            }
            config.HandleInput();
        }
示例#10
0
 public ScoreChallenge(GameManagerWrapper gameManager)
 {
     this.gameManager = gameManager;
     score            = 0;
 }
示例#11
0
 public IChallenge CreateChallenge(GameManagerWrapper gameManager)
 {
     return(new ScoreChallenge(gameManager));
 }