Hi,
I’m loading all the data of my game using
SaveVariables.current = (SaveVariables)bf.Deserialize(file);
But I have to add a new variable to SaveVariables, like that :
using UnityEngine;
using System.Collections;
[System.Serializable]
public class SaveVariables
{
public static SaveVariables current;
public int c = 500;
public bool[] m = new bool[4];
public bool[] md = new bool[4];
public bool[] p = new bool[5];
public bool[] pd = new bool[5];
public int roundsPlayed = 0;
public int gamesPlayed = 0;
public int bulletsShot = 0;
public int grenadesShot = 0;
public int lazersShot = 0;
public int bouncyShot = 0;
public int playersDead = 0;
public int powerupsDestroyed = 0;
public bool sound = false;
public int ad = 0;
public string adTime = "";
public bool rated = false;
public string newVar = ""; // NEW VARIABLE
}
After adding the new var, I’m getting an error because an error because this newVar don’t exists in the save file
How can I fix that ?