Esempio n. 1
0
    private void StartSingScene(SongMeta songMeta)
    {
        SingSceneData singSceneData = new SingSceneData();

        singSceneData.SelectedSongMeta = songMeta;

        List <PlayerProfile> allPlayerProfiles    = PlayerProfileManager.Instance.PlayerProfiles;
        PlayerProfile        defaultPlayerProfile = allPlayerProfiles[0];
        PlayerProfile        playerProfile        = selectedPlayerProfile.OrIfNull(defaultPlayerProfile);

        singSceneData.AddPlayerProfile(playerProfile);

        SceneNavigator.Instance.LoadScene(EScene.SingScene, singSceneData);
    }
Esempio n. 2
0
    void Awake()
    {
        // Load scene data from static reference, if any
        sceneData = SceneNavigator.Instance.GetSceneData(sceneData);

        // Fill scene data with default values
        if (sceneData.SelectedSongMeta == null)
        {
            sceneData.SelectedSongMeta = GetDefaultSongMeta();
        }

        if (sceneData.SelectedPlayerProfiles == null || sceneData.SelectedPlayerProfiles.Count == 0)
        {
            sceneData.AddPlayerProfile(GetDefaultPlayerProfile());
        }
    }