public UnlockData(UnlockManager unlock) { u_sorter = unlock.u_sorter; u_clayProducer = unlock.u_clayProducer; u_eyeMaker = unlock.u_eyeMaker; u_mouthMaker = unlock.u_mouthMaker; u_legMaker = unlock.u_legMaker; u_armMaker = unlock.u_armMaker; level = unlock.level; }
public static void SaveUnlocks(UnlockManager unlock) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/unlocks.save"; FileStream stream = new FileStream(path, FileMode.Create); UnlockData data = new UnlockData(unlock); formatter.Serialize(stream, data); stream.Close(); }
private void Awake() { if (unlocks == null) { unlocks = this; FirstTimeSetup(); } else { Destroy(this.gameObject); } }