Exemplo n.º 1
0
 public void MusicButton()
 {
     if (GamePrefrences.GetMusicState() == 0)
     {
         GamePrefrences.SetMusicState(1);
         MusicController.instance.PlayMusic(true);
         musicButton.image.sprite = musicIcon[1];
     }
     else if (GamePrefrences.GetMusicState() == 1)
     {
         GamePrefrences.SetMusicState(0);
         MusicController.instance.PlayMusic(false);
         musicButton.image.sprite = musicIcon[0];
     }
 }
Exemplo n.º 2
0
    void InitializeVaribles()
    {
        if (!PlayerPrefs.HasKey("Game Initialized"))
        {
            GamePrefrences.SetEasyDifficulty(0);
            GamePrefrences.SetEasyDifficultyCoinScore(0);
            GamePrefrences.SetEasyDifficultyHighScore(0);

            GamePrefrences.SetMediumDifficulty(1);
            GamePrefrences.SetMediumDifficultyCoinScore(0);
            GamePrefrences.SetMediumDifficultyHighScore(0);

            GamePrefrences.SetHardDifficulty(0);
            GamePrefrences.SetHardDifficultyCoinScore(0);
            GamePrefrences.SetHardDifficultyHighScore(0);

            GamePrefrences.SetMusicState(0);

            PlayerPrefs.SetInt("Game Initialized", 123);
        }
    }