๊ธ€์— ๋Œ“๊ธ€์ด ์•ˆ์จ์ง€๊ธธ๋ž˜ ๋Œ“๊ธ€ ๋ง๋Œ€๋กœย ๋””๋ฒ„๊น… ํ•ด๋ณด๋‹ˆ๊นŒย 

ย public void Save()

ย  ย  {

ย  ย  ย  ย  string saveData = JsonUtility.ToJson(this, true);

ย  ย  ย  ย  BinaryFormatter bf = new BinaryFormatter();

ย  ย  ย  ย  FileStream file = File.Create(string.Concat(Application.persistentDataPath, savePath));

ย  ย  ย  ย  bf.Serialize(file, saveData);

ย  ย  ย  ย  file.Close();

ย  ย  }


ย  ย  public void Load()

ย  ย  {

ย  ย  ย  ย  if(File.Exists(string.Concat(Application.persistentDataPath, savePath)))

ย  ย  ย  ย  {

ย  ย  ย  ย  ย  ย  BinaryFormatter bf = new BinaryFormatter();

ย  ย  ย  ย  ย  ย  FileStream file = File.Open(string.Concat(Application.persistentDataPath),ย 

ย  ย  ย  ย  ย  ย  ย  ย  FileMode.Open);

ย  ย  ย  ย  ย  ย  JsonUtility.FromJsonOverwrite(bf.Deserialize(file).ToString(), this);

ย  ย  ย  ย  ย  ย  file.Close();

ย  ย  ย  ย  }

ย  ย  }


์—ฌ๊ธฐ์„œ FileStream file = File.Open(string.Concat(Application.persistentDataPath), FileMode.Open); ์ด๋ถ€๋ถ„์— ๋ญ”๊ฐ€ ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š”๊ฑฐ ๊ฐ™์€๋ฐ ๋‚ด๊ฐ€ ์ฝ”๋”ฉ ์ข†๋ฐฅ์ด๋ผ์„œ ๊ทธ๋Ÿฐ๊ฐ€ ์ฝ”๋“œ์— ํ‹€๋ฆฐ ๋ถ€๋ถ„์€ ์—†๋Š”๊ฑฐ ๊ฐ™์•„ ๋ณด์˜€๋Š”๋ฐ ํ˜น์‹œ ํ‹€๋ฆฐ ๋ถ€๋ถ„ ์žˆ์Œ?