I have a level unlocking script which uses a .dat file
using UnityEngine;
using System.Collections;
using System;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
public class Persistence : MonoBehaviour {
public bool Level1;
public bool Level2;
void Awake () {
DontDestroyOnLoad(gameObject);
}
public void Save () {
BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Open(Application.persistentDataPath + "/Levelinfo.dat", FileMode.Open);
sData data = new sData();
data.Level1 = Level1;
data.Level2 = Level2;
bf.Serialize(file, data);
file.Close();
}
public void Load () {
if(File.Exists(Application.persistentDataPath + "/Levelinfo.dat"))
{
BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Open(Application.persistentDataPath+"/Levelinfo.dat");
sData data = (sData)bf.Deserialize(file);
file.Close();
Level1 = data.Level1;
Level2 = data.Level2;
}
}
}
[Serializable]
class sData
{
public bool Level1;
public bool Level2;
}
In this void:
public void Load () {
if(File.Exists(Application.persistentDataPath + "/Levelinfo.dat"))
{
BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Open(Application.persistentDataPath+"/Levelinfo.dat");
sData data = (sData)bf.Deserialize(file);
file.Close();
Level1 = data.Level1;
Level2 = data.Level2;
}
}
}
In this line:
FileStream file = File.Open(Application.persistentDataPath+“/Levelinfo.dat”);
When I get my mouse over it it says “unknown resolve error”

Console keeps telling me "No overload for method ‘Open’ takes ‘1’ arguments. Doesn’t it already have 1 argument already?