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; }
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)); }
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); } }
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; } }
void SaveDifficulty(GameLauncher.Difficulty difficulty) { PlayerPrefs.SetInt("Difficulty", (int)difficulty); }