// Save/Load void SaveGame() { SaveSettings(); if (gameData == null) { return; } if (!File.Exists(Application.persistentDataPath + Path.DirectorySeparatorChar + "SaveData")) { Directory.CreateDirectory(Application.persistentDataPath + Path.DirectorySeparatorChar + "SaveData"); } string path = Application.persistentDataPath + Path.DirectorySeparatorChar + "SaveData" + Path.DirectorySeparatorChar + "save" + gameData.saveSlot + ".gd"; SaveChainData.Save("chain" + gameData.saveSlot); BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(path); bf.Serialize(file, gameData); file.Close(); }
void Start() { triggers = Resources.LoadAll <ChainTrigger>("ChainResources/Triggers"); SaveChainData.Save("OriginalChainData"); }