Exemplo n.º 1
0
    public void FinishScene(bool isAfterEndOfSong)
    {
        // Open the singing results scene.
        SingingResultsSceneData singingResultsSceneData = new SingingResultsSceneData();

        singingResultsSceneData.SongMeta = SongMeta;
        singingResultsSceneData.PlayerProfileToMicProfileMap = sceneData.PlayerProfileToMicProfileMap;

        // Check if the full song has been sung, i.e., the playback position is after the last note.
        // This determines whether the statistics should be updated and the score should be recorded.
        bool isAfterLastNote = true;

        foreach (PlayerController playerController in PlayerControllers)
        {
            SingingResultsSceneData.PlayerScoreResultData scoreData = new SingingResultsSceneData.PlayerScoreResultData();
            scoreData.TotalScore                = playerController.PlayerScoreController.TotalScore;
            scoreData.GoldenNotesScore          = playerController.PlayerScoreController.GoldenNotesTotalScore;
            scoreData.NormalNotesScore          = playerController.PlayerScoreController.NormalNotesTotalScore;
            scoreData.PerfectSentenceBonusScore = playerController.PlayerScoreController.PerfectSentenceBonusTotalScore;
            singingResultsSceneData.AddPlayerScores(playerController.PlayerProfile, scoreData);

            Note lastNoteInSong = playerController.GetLastNoteInSong();
            if (!isAfterEndOfSong && CurrentBeat < lastNoteInSong.EndBeat)
            {
                isAfterLastNote = false;
            }
        }

        if (isAfterLastNote)
        {
            UpdateSongFinishedStats();
        }

        SceneNavigator.Instance.LoadScene(EScene.SingingResultsScene, singingResultsSceneData);
    }
Exemplo n.º 2
0
 public void Init(int playerProfileIndex,
                  PlayerProfile playerProfile,
                  SingingResultsSceneData.PlayerScoreResultData playerScoreData,
                  MicProfile micProfile)
 {
     SetPlayerProfile(playerProfileIndex, playerProfile, micProfile);
     SetNormalNotesScore(playerScoreData.NormalNotesScore);
     SetGoldenNotesScore(playerScoreData.GoldenNotesScore);
     SetPerfectSentenceBonusScore(playerScoreData.PerfectSentenceBonusScore);
     SetTotalScore(playerScoreData.TotalScore);
 }
    public SceneData GetDefaultSceneData()
    {
        SingingResultsSceneData data = new SingingResultsSceneData();

        SongMetaManager.Instance.WaitUntilSongScanFinished();
        data.SongMeta = SongMetaManager.Instance.GetFirstSongMeta();

        SingingResultsSceneData.PlayerScoreResultData playerScoreData = new SingingResultsSceneData.PlayerScoreResultData();
        playerScoreData.TotalScore                = 6500;
        playerScoreData.NormalNotesScore          = 4000;
        playerScoreData.GoldenNotesScore          = 2000;
        playerScoreData.PerfectSentenceBonusScore = 500;

        PlayerProfile playerProfile = SettingsManager.Instance.Settings.PlayerProfiles[0];

        data.AddPlayerScores(playerProfile, playerScoreData);
        data.PlayerProfileToMicProfileMap[playerProfile] = SettingsManager.Instance.Settings.MicProfiles.FirstOrDefault();
        return(data);
    }
Exemplo n.º 4
0
    private void FillLayout()
    {
        SongMeta songMeta   = sceneData.SongMeta;
        string   titleText  = (String.IsNullOrEmpty(songMeta.Title)) ? "" : songMeta.Title;
        string   artistText = (String.IsNullOrEmpty(songMeta.Artist)) ? "" : " - " + songMeta.Artist;

        songLabel.text = titleText + artistText;

        int        i = 0;
        GameObject selectedLayout = GetSelectedLayout();

        foreach (PlayerProfile playerProfile in sceneData.PlayerProfiles)
        {
            sceneData.PlayerProfileToMicProfileMap.TryGetValue(playerProfile, out MicProfile micProfile);
            SingingResultsSceneData.PlayerScoreResultData playerScoreData = sceneData.GetPlayerScores(playerProfile);
            SingingResultsPlayerUiController[]            uiControllers   = selectedLayout.GetComponentsInChildren <SingingResultsPlayerUiController>();
            if (i < uiControllers.Length)
            {
                uiControllers[i].Init(i, playerProfile, playerScoreData, micProfile);
            }
            i++;
        }
    }