Beispiel #1
0
    private void OnGameCompleted(float time)
    {
        GameManager.Instance.OnCompleted -= OnGameCompleted;

        // here we are stopping the clock flag, adding to the total time and resetting the challenge time.

        // stop clock and reset
        pModel.ClockIsStopped = true;

        // save current time to total time
        // The Challenge Time should get added up to the TotalChallengeTime
        // We should save the TotalChallengeTime and the current ChallengeIndex to the server.
        // If the user leaves early, we can load up the TotalChallengeTime and ChallengeIndex from the server to resume play
        pModel.SaveCurrentTotalTime();

        // before we reset ChallengeTime, lets save it to CurrentCompletedChallengeTime
        // we will be using it to display the time in the Congratulations Screen
        pModel.CurrentCompletedChallengeTime = pModel.ChallengeTime;

        // now reset ChallengeTime to 0
        pModel.ChallengeTime = 0;

        // transition out
        LeanTween.move(topHeaderBg, headerPanelFrom, .5f).setEase(LeanTweenType.easeOutCubic);
        LeanTween.textColor(gameTimeText, new Color(0f, 0f, 0f, 0f), 0.5f).setEase(LeanTweenType.easeOutCubic);
        LeanTween.move(timeTopPanel, timePanelFrom, 0.5f).setEase(LeanTweenType.easeOutCubic);
        LeanTween.move(pauseButton, pauseButtonFrom, 0.5f).setEase(LeanTweenType.easeOutCubic);
        LeanTween.move(muteButton, muteButtonFrom, 0.5f).setEase(LeanTweenType.easeOutCubic);
        LeanTween.alpha(superTireSmallLogo, 0f, 0.5f).setEase(LeanTweenType.easeOutCubic).setOnComplete(GotoNextScreen);
    }