Esempio n. 1
0
    public void SaveProgress()
    {
        if (MapLoader.MapPlayer.HightScore < score)
        {
            MapLoader.MapPlayer.HightScore = score;
        }
        int s = setStar(score);

        if (MapLoader.MapPlayer.Stars < s)
        {
            MapLoader.MapPlayer.Stars = s;
        }
        DataLoader.DataPlayer[MapLoader.MapPlayer.Level - 1] = MapLoader.MapPlayer;
        PlayerPrefsSerializer p = new PlayerPrefsSerializer();

        p.Maps = p.LoadPref();
        p.Update(MapLoader.MapPlayer.Level, MapLoader.MapPlayer);
        Player m = new Player();

        m          = p.Maps[MapLoader.MapPlayer.Level];
        m.UnLocked = true;
        if (MapLoader.MapPlayer.Level < 297)
        {
            p.Update(MapLoader.MapPlayer.Level + 1, m);
            DataLoader.DataPlayer[MapLoader.MapPlayer.Level].UnLocked = true;
        }
        MapLoader.MapPlayer = m;
    }
Esempio n. 2
0
 void SavePlayer()
 {
     if (MapLoader.MapPlayer.Level != 297)
     {
         if (MapLoader.MapPlayer.HightScore < score)
         {
             MapLoader.MapPlayer.HightScore = score;
         }
         int s = setStar(score);
         if (MapLoader.MapPlayer.Stars < s)
         {
             MapLoader.MapPlayer.Stars = s;
         }
         DataLoader.DataPlayer[MapLoader.MapPlayer.Level - 1] = MapLoader.MapPlayer;
         PlayerPrefsSerializer p = new PlayerPrefsSerializer();
         p.Maps = p.LoadPref();
         p.Update(MapLoader.MapPlayer.Level, MapLoader.MapPlayer);
         Player m = new Player();
         m          = p.Maps[MapLoader.MapPlayer.Level];
         m.UnLocked = true;
         if (MapLoader.MapPlayer.Level < 297)
         {
             p.Update(MapLoader.MapPlayer.Level + 1, m);
             DataLoader.DataPlayer[MapLoader.MapPlayer.Level].UnLocked = true;
         }
         MapLoader.MapPlayer = m;
         Application.LoadLevel(GlobalConsts.SCENE_PLAY);
     }
     else
     {
         Application.LoadLevel(GlobalConsts.SCENE_HOME);
     }
 }
Esempio n. 3
0
    void SavePlayer()
    {
        if (MapLoader.MapPlayer.Level != 297)
        {
            if (MapLoader.MapPlayer.HightScore < score)
                MapLoader.MapPlayer.HightScore = score;
            int s = setStar(score);
            if (MapLoader.MapPlayer.Stars < s)
                MapLoader.MapPlayer.Stars = s;
            DataLoader.DataPlayer[MapLoader.MapPlayer.Level - 1] = MapLoader.MapPlayer;
            PlayerPrefsSerializer p = new PlayerPrefsSerializer();
            p.Maps = p.LoadPref();
            p.Update(MapLoader.MapPlayer.Level, MapLoader.MapPlayer);
            Player m = new Player();
            m = p.Maps[MapLoader.MapPlayer.Level];
            m.UnLocked = true;
            if (MapLoader.MapPlayer.Level < 297)
            {
                p.Update(MapLoader.MapPlayer.Level + 1, m);
                DataLoader.DataPlayer[MapLoader.MapPlayer.Level].UnLocked = true;
            }
            MapLoader.MapPlayer = m;
            Application.LoadLevel(GlobalConsts.SCENE_PLAY);
        }
        else Application.LoadLevel(GlobalConsts.SCENE_HOME);

    }