Exemplo n.º 1
0
    public void GoToResolutionScreen()
    {
        var globalState = GlobalState.instance;
        var message     = new OnResolutionScreen(
            globalState.playerScore,
            new Dictionary <PlayerProfile, int>(globalState.profiles),
            globalState.playerDeathPosition
            );

        SceneManager.LoadScene(SceneNames.mainResolutionScreenName, LoadSceneMode.Single);
        message.PostEvent();
    }
Exemplo n.º 2
0
    public void On(OnResolutionScreen message)
    {
        /// Do here all sorts of leaderboard stuff before updating
        /// the LeaderboardView
        Leaderboard leaderboard = GetLeaderboardForCurrentMode();

        currentPlayerPlace = leaderboard.GetPlaceOnLeaderboardForPlayer(message.score);
        bool isOnLeaderboard = currentPlayerPlace <= maxPlayersOnLeaderboard;

        string  sceneName           = GlobalState.instance.playerDeathSceneName;
        int     playerScore         = GlobalState.instance.playerScore;
        Vector3 playerDeathPosition = GlobalState.instance.playerDeathPosition;

        leaderboard.AddNewEntry(new LeaderboardEntry("You", playerScore, playerDeathPosition, sceneName, true));

        new OnLeaderboardDisplay(leaderboard, new LeaderboardViewInfo(isOnLeaderboard, currentPlayerPlace, playerScore))
        .SetDeliveryType(MessageDeliveryType.Immediate)
        .PostEvent();
    }