private void LoadRecipes() { var path = $"{Application.persistentDataPath}/recipes.dat"; if (File.Exists(path)) { discoveredRecipes.ints = BinaryIO.ReadFile <List <int> >(path); } }
private void LoadInventories() { for (int i = 0; i < inventories.Length; i++) { var path = $"{Application.persistentDataPath}/{i}.inv"; if (File.Exists(path)) { inventories[i].value = BinaryIO.ReadFile <SerializableInventory>(path).Deserialize(itemDB); } } }
public void LoadScriptables() { LoadRecipes(); LoadInventories(); for (int i = 0; i < objects.Count; i++) { var objPath = Application.persistentDataPath + string.Format("/{0}.json", i); if (File.Exists(objPath)) { var json = BinaryIO.ReadFile <string>(objPath); JsonUtility.FromJsonOverwrite(json, objects[i]); } } }