public void Save(StarLife life, AllSoundFx sound)
    {
        string gamePath = Application.persistentDataPath + "/Player.dat";

        FileStream fstream = new FileStream(gamePath, FileMode.OpenOrCreate);

        BinaryFormatter formatter = new BinaryFormatter();

        GameStats gStats = new GameStats(life, sound);

        formatter.Serialize(fstream, gStats);

        fstream.Close();
    }
Exemple #2
0
    public GameStats(StarLife life, AllSoundFx sound)
    {
        #region For all Gameplay

        isAdDisabled          = life.isAdRemoved;
        isLimUnlock           = life.isLimitlessUnlocked;
        diamonds              = life.diamonds;
        highScoreLL           = life.HighScore;
        totalLockedLevel      = life.totalClassicLocked;
        isActive              = life.isGameActive;
        isMusicOn             = sound.isSoundOn;
        isGameOverPanelActive = life.isGameOverPanelActive;
        VideoadCounter        = life.adCounter;
        isRatemeShown         = life.isRatingShown;
        ratemecounter         = life.rateCounter;
        isStartDisabled       = life.isStartIntroDisabled;
        for (int i = 0; i < 60; i++)
        {
            AdlimitCounter[i] = life.AdlimitCounter[i];
        }

        #endregion
    }