示例#1
0
    private void UpdateScore()
    {
        int _newScore = (int)(_player.transform.position.x - _playerStartPos.x);

        if (_newScore > _saver.GetScore())
        {
            _saver.SetScore(_newScore);
            UpdateScoreText();
        }
    }
示例#2
0
    void OnDestroy()
    {
        if (a.GetScore() > highscore)
        {
            ;
        }
        highscore = a.GetScore();

        PlayerPrefs.SetInt("highscore", highscore);
        PlayerPrefs.Save();
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        MainMenuCanvas.enabled     = true;
        SettingsCanvas.enabled     = false;
        CreditsCanvas.enabled      = false;
        HighscoreCanvas.enabled    = false;
        NewHighscoreCanvas.enabled = false;

        GameManager.LoadSettings();
        HighscoreScript.LoadHighscores();
        UpdateHighscoreTable();

        if (tempScore.GetScore() > (int)0)
        {
            scoreText.text = "Final Score: " + tempScore.GetScore();
            foreach (ScoreData s in HighscoreScript.highscores)
            {
                if (s != null)
                {
                    if (tempScore.GetScore() > s.GetScore())
                    {
                        MainMenuCanvas.enabled     = false;
                        NewHighscoreCanvas.enabled = true;
                        break;
                    }
                }
                else
                {
                    MainMenuCanvas.enabled     = false;
                    NewHighscoreCanvas.enabled = true;
                    break;
                }
            }
        }

        AudioToggle.isOn    = GameManager.PlayAudio;
        TutorialToggle.isOn = GameManager.DisplayTutorial;
        versionText.text    = "Version " + Application.version;
    }
示例#4
0
 public PlayerData(ScoreData data)
 {
     score = data.GetScore();
     coins = data.GetCoins();
 }
示例#5
0
 // Update is called once per frame
 void Update()
 {
     text.text = a.GetScore().ToString();
 }
 public ScoreValue GetScore(string uid)
 {
     return(_scoreData.GetScore(uid));
 }