Ejemplo n.º 1
0
    public void writeMusic()
    {
        MusicAndSound newMusicAndSound = new MusicAndSound();

        newMusicAndSound.sound = sound;
        newMusicAndSound.music = music;
        string str2 = JsonUtility.ToJson(newMusicAndSound);

        PlayerPrefs.SetString("MusicAndSound", str2);
    }
Ejemplo n.º 2
0
    public void setInfo()
    {
        string        str2          = PlayerPrefs.GetString("MusicAndSound", null);
        MusicAndSound musicAndSound = JsonUtility.FromJson <MusicAndSound> (str2);

        if (musicAndSound != null)
        {
            music = musicAndSound.music;
            sound = musicAndSound.sound;
        }
    }
Ejemplo n.º 3
0
    public void setInfo()
    {
        string str  = PlayerPrefs.GetString("info" + levelId.ToString(), null);
        string str2 = PlayerPrefs.GetString("MusicAndSound", null);

        info = JsonUtility.FromJson <LevelInfo> (str);
        MusicAndSound musicAndSound = JsonUtility.FromJson <MusicAndSound> (str2);

        if (info != null)
        {
            fruits       = info.collectedFruits;
            fruitsNumber = info.fruitsNumber;
        }
        if (musicAndSound != null)
        {
            music = musicAndSound.music;
            sound = musicAndSound.sound;
        }
    }