Example #1
0
    public void DifficulyChanged(int difficulty)
    {
        if (Locked)
        {
            return;
        }
        Locked = true;

        if (difficulty == 1)
        {
            DifficultyMedium.isOn = false;
            DifficultyHard.isOn   = false;
            GameDifficulty        = GameLauncher.Difficulty.Easy;
            SaveDifficulty(GameLauncher.Difficulty.Easy);
        }
        else if (difficulty == 2)
        {
            DifficultyEasy.isOn = false;
            DifficultyHard.isOn = false;
            GameDifficulty      = GameLauncher.Difficulty.Medium;
            SaveDifficulty(GameLauncher.Difficulty.Medium);
        }
        else if (difficulty == 3)
        {
            DifficultyMedium.isOn = false;
            DifficultyEasy.isOn   = false;
            GameDifficulty        = GameLauncher.Difficulty.Hard;
            SaveDifficulty(GameLauncher.Difficulty.Hard);
        }

        Locked = false;
    }
Example #2
0
    public static int GetScoreByDifficulty(GameLauncher.Difficulty difficulty)
    {
        if (difficulty == GameLauncher.Difficulty.Hard)
        {
            return(PlayerPrefs.GetInt("HSCORE_ONE", 0));
        }

        if (difficulty == GameLauncher.Difficulty.Medium)
        {
            return(PlayerPrefs.GetInt("HSCORE_TWO", 0));
        }

        return(PlayerPrefs.GetInt("HSCORE_THREE", 0));
    }
Example #3
0
    public static void SetScoreByDifficulty(GameLauncher.Difficulty difficulty, int score)
    {
        if (difficulty == GameLauncher.Difficulty.Hard)
        {
            PlayerPrefs.SetInt("HSCORE_ONE", score);
        }

        else if (difficulty == GameLauncher.Difficulty.Medium)
        {
            PlayerPrefs.SetInt("HSCORE_TWO", score);
        }

        else
        {
            PlayerPrefs.SetInt("HSCORE_THREE", score);
        }
    }
Example #4
0
    void Start()
    {
        //RequestBanner();
        RequestInterstitial();
        //-----------Animator-------------------
        pnlDifficultyAnimator = PanelDifficultySelection.GetComponent <Animator>();
        pnlHighScoreAnimator  = PanelHighScore.GetComponent <Animator>();

        //-----------DIFFICULTY-------------------
        GameDifficulty = GetDifficulty();
        if (GameDifficulty == GameLauncher.Difficulty.Medium)
        {
            DifficultyMedium.isOn = true;
        }
        else if (GameDifficulty == GameLauncher.Difficulty.Hard)
        {
            DifficultyHard.isOn = true;
        }
        else if (GameDifficulty == GameLauncher.Difficulty.Easy)
        {
            DifficultyEasy.isOn = true;
        }
    }
Example #5
0
 void SaveDifficulty(GameLauncher.Difficulty difficulty)
 {
     PlayerPrefs.SetInt("Difficulty", (int)difficulty);
 }