示例#1
0
 void ScoreBaseOnDifficulty()
 {
     if (GamePrefences.GetEasyDifficultyState() == 1)
     {
         SetScore(GamePrefences.GetEasyDifficultyHighscore(), GamePrefences.GetEasyDifficultyCoinScore());
     }
     if (GamePrefences.GetMediumDifficultyState() == 1)
     {
         SetScore(GamePrefences.GetMediumDifficultyHighscore(), GamePrefences.GetMediumDifficultyCoinScore());
     }
     if (GamePrefences.GetHardDifficultyState() == 1)
     {
         SetScore(GamePrefences.GetHardDifficultyHighscore(), GamePrefences.GetHardDifficultyCoinScore());
     }
 }
示例#2
0
    public void CheckGameStatus(int score, int coinScore, int lifeScore)
    {
        Debug.Log("Chech game status");
        if (lifeScore < 0)
        {
            Debug.Log("LifeSCore<2");
            if (GamePrefences.GetEasyDifficultyState() == 1)
            {
                Debug.Log("GetEasyLevel");
                int highScore     = GamePrefences.GetEasyDifficultyHighscore();
                int coinHighScore = GamePrefences.GetEasyDifficultyCoinScore();
                if (highScore < score)
                {
                    Debug.Log("Score");
                    GamePrefences.SetEasyDifficultyHighscore(score);
                }
                if (coinHighScore < coinScore)
                {
                    Debug.Log("CoinScore");
                    GamePrefences.SetEasyDifficultyCoinScore(coinScore);
                }
            }
            if (GamePrefences.GetMediumDifficultyState() == 1)
            {
                Debug.Log("MediumLevel");
                int highScore     = GamePrefences.GetMediumDifficultyHighscore();
                int coinHighScore = GamePrefences.GetMediumDifficultyCoinScore();

                if (highScore < score)
                {
                    Debug.Log("7");
                    GamePrefences.SetMediumDifficultyHighscore(score);
                }
                if (coinHighScore < coinScore)
                {
                    //  Debug.Log("8");
                    GamePrefences.SetMediumDifficultyCoinScore(coinScore);
                }
            }
            if (GamePrefences.GetHardDifficultyState() == 1)
            {
                Debug.Log("HardLevel");
                int highScore     = GamePrefences.GetHardDifficultyHighscore();
                int coinHighScore = GamePrefences.GetHardDifficultyCoinScore();

                if (highScore < score)
                {
                    //    Debug.Log("10");
                    GamePrefences.SetHardDifficultyHighscore(score);
                }
                if (coinHighScore < coinScore)
                {
                    //  Debug.Log("11");
                    GamePrefences.SetHardDifficultyCoinScore(coinScore);
                }
            }
            gameStartedFromMainMenu     = false;
            gameRestartedAfterPlayerDie = false;

            GamePlyControllar.instance.gameOverShowpenal(score, coinScore);
        }
        else
        {
            //debug.Log("12");
            this.score     = score;
            this.coinScore = coinScore;
            this.lifeScore = lifeScore;

            //GamePlyControllar.instance.SetScore(score );
            //GamePlyControllar.instance.SetCoinScore(coinScore );
            //GamePlyControllar.instance.SetLifeScore(lifeScore );

            gameStartedFromMainMenu     = false;
            gameRestartedAfterPlayerDie = true;
            GamePlyControllar.instance.PlayerDiedRestartedgame();
        }
    }