Esempio n. 1
0
    void OnGameOver(int coins, int score)
    {
        DiffLevel level = GetDiffLevel();

        UpdateCoins(level, coins);
        UpdateScore(level, score);
    }
Esempio n. 2
0
    void UpdateCoins(DiffLevel level, int coins)
    {
        int highCoins = GetHighCoins(level);

        if (highCoins < coins)
        {
            SetHighScore(level, coins);
        }
    }
Esempio n. 3
0
    void UpdateScore(DiffLevel level, int score)
    {
        int highScore = GetHighScore(level);

        if (highScore < score)
        {
            SetHighScore(level, score);
        }
    }
Esempio n. 4
0
    int GetHighCoins(DiffLevel level)
    {
        switch (level)
        {
        case DiffLevel.Easy:
            return(GamePreferences.GetEasyDifficultyCoinScore());

        case DiffLevel.Medium:
            return(GamePreferences.GetMediumDifficultyCoinScore());

        case DiffLevel.Hard:
            return(GamePreferences.GetHardDifficultyCoinScore());
        }
        throw new System.SystemException("unhandled level");
    }
Esempio n. 5
0
    void SetHighCoins(DiffLevel level, int coins)
    {
        switch (level)
        {
        case DiffLevel.Easy:
            GamePreferences.SetEasyDifficultyCoinScore(coins);
            break;

        case DiffLevel.Medium:
            GamePreferences.SetMediumDifficultyCoinScore(coins);
            break;

        case DiffLevel.Hard:
            GamePreferences.SetHardDifficultyCoinScore(coins);
            break;

        default:
            throw new System.SystemException("unhandled level");
        }
    }
        public void SetDifficultyLevel(DiffLevel diffLevel)
        {
            if (!IsPlayGame)
            {
                switch (diffLevel)
                {
                case DiffLevel.Novice:
                    _factorCheck = novice.difficultyLevel;
                    break;

                case DiffLevel.Casual:
                    _factorCheck = casual.difficultyLevel;
                    break;

                case DiffLevel.Master:
                    _factorCheck = master.difficultyLevel;
                    break;
                }
            }
        }
Esempio n. 7
0
	void Awake(){
		DL = this;
	}