Assets/Scripts/Custom/EndScreen.cs
/// <summary>
/// Method disabling the Vuforia instance and some UI-Elements
/// After that it enables the UI-Elements used to display the final score and the remaining since the last caught ghost
/// At the end it saves the current score with the PlayersPrefs Class to ensure that the score is not lost if the app would crash
/// </summary>
Method disabling the Vuforia instance and some UI-Elements
After that it enables the UI-Elements used to display the final score and the remaining since the last caught ghost
At the end it saves the current score with the PlayersPrefs Class to ensure that the score is not lost if the app would crash
Method disabling the Vuforia instance and some UI - Elements After that it enables the UI - Elements used to display the final score and the remaining since the last caught ghost At the end it saves the current score with the PlayersPrefs Class to ensure that the score is not lost if the app would crash
public void ActivateEndScreen()
    {
        if (!hasBeenBuilt)
        {
            VuforiaBehaviour.Instance.enabled = false;
            score.countText.gameObject.SetActive(false);
            score.ghostColorText.gameObject.SetActive(false);
            powerUp.show = false;
            bar.gameObject.SetActive(false);
            endScreenBackground.gameObject.SetActive(true);
            FinalScore.gameObject.SetActive(true);
            LastCaughtTime.gameObject.SetActive(true);
            int endscore = baseScore + countdown.GetTimeBonus();
            if (score.score > 0)
            {
                score.score = endscore;
            }
            score.AddScoreToLeaderboard(score.score);
        }
        SetEndScreenPoints();
        countdown.GameHasEnded = true;
        hasBeenBuilt = true;
    }
public void ActivateEndScreen ( ) { if ( ! hasBeenBuilt ) { VuforiaBehaviour . Instance . enabled = false ; score . countText . gameObject . SetActive ( false ) ; score . ghostColorText . gameObject . SetActive ( false ) ; powerUp . show = false ; bar . gameObject . SetActive ( false ) ; endScreenBackground . gameObject . SetActive ( true ) ; FinalScore . gameObject . SetActive ( true ) ; LastCaughtTime . gameObject . SetActive ( true ) ; int endscore = baseScore + countdown . GetTimeBonus ( ) ; if ( score . score > 0 ) { score . score = endscore ; } score . AddScoreToLeaderboard ( score . score ) ; } SetEndScreenPoints ( ) ; countdown . GameHasEnded = true ; hasBeenBuilt = true ; }
Method disabling the Vuforia instance and some UI-Elements
After that it enables the UI-Elements used to display the final score and the remaining since the last caught ghost
At the end it saves the current score with the PlayersPrefs Class to ensure that the score is not lost if the app would crash
Method disabling the Vuforia instance and some UI - Elements After that it enables the UI - Elements used to display the final score and the remaining since the last caught ghost At the end it saves the current score with the PlayersPrefs Class to ensure that the score is not lost if the app would crash