public static void SaveData(CustSet cust) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/Player.bruh"; FileStream stream = new FileStream(path, FileMode.Create); DataToSave data = new DataToSave(cust); formatter.Serialize(stream, data); stream.Close(); }
public DataToSave(CustSet cust) { skinIndex = cust.skinIndex; eyesIndex = cust.eyesIndex; mouthIndex = cust.mouthIndex; hairIndex = cust.hairIndex; armourIndex = cust.armourIndex; clothesIndex = cust.clothesIndex; charName = cust.charName; for (int i = 0; i < 7; i++) { stats[i] = (cust.stats[i] + cust.tempStats[i]); } selectedClass = cust.selectedClass[cust.selectedClassIndex]; selectedRace = cust.selectedRace[cust.selectedRaceIndex]; }