public void create(string s) { if (s=="") { throw new Exception("Empty file name exception"); } s=s.Replace(' ', '_'); foreach (char c in Path.GetInvalidFileNameChars()) { s=s.Replace(c, '_'); } BinaryFormatter bf=new BinaryFormatter(); FileStream file=File.Create(Application.persistentDataPath+"/saves/"+s+".save"); playerSave save=new playerSave(); save.fileName=s; bf.Serialize(file, save); Application.LoadLevel(1); }
public void create(string s) { if (s == "") { throw new Exception("Empty file name exception"); } s = s.Replace(' ', '_'); foreach (char c in Path.GetInvalidFileNameChars()) { s = s.Replace(c, '_'); } BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + "/saves/" + s + ".save"); playerSave save = new playerSave(); save.fileName = s; bf.Serialize(file, save); Application.LoadLevel(1); }
// Use this for initialization void Start () { current = this; }
// Use this for initialization void Start() { current = this; }