Пример #1
0
 public void Load()
 {
     if (File.Exists(Application.persistentDataPath + "/xpInfo.dat"))
     {
         Thread.Sleep(2000);
         BinaryFormatter bf       = new BinaryFormatter();
         FileStream      fs       = File.Open(Application.persistentDataPath + "/xpInfo.dat", FileMode.Open);
         XpInfo          loadData = (XpInfo)bf.Deserialize(fs);
         fs.Close();
         this.xp = 0;
         UpdateXp(loadData.xp);
     }
 }
Пример #2
0
    public void Save()
    {
        this.xp = 0;
        UpdateXp(5000000);
        BinaryFormatter bf = new BinaryFormatter();
        FileStream      fs = File.Open(Application.persistentDataPath + "/xpInfo.dat", FileMode.OpenOrCreate);

        XpInfo saveData = new XpInfo();

        saveData.xp = this.xp;

        bf.Serialize(fs, saveData);
        fs.Close();
        UpdateXp(-5000000);

        //Debug.Log(Application.persistentDataPath);
    }
Пример #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (CreditsEarned?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (CurrentCsr?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (KilledByOpponentDetails?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (KilledOpponentDetails?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ MeasurementMatchesLeft;
         hashCode = (hashCode * 397) ^ (MetaCommendationDeltas?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (PreviousCsr?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ProgressiveCommendationDeltas?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (RewardSets?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (XpInfo?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }