public static UnitSaveData LoadUnit(string path) { string filePath = baseSavePath + "/" + path + ".json"; if (File.Exists(filePath)) { return(JSONReadWrite.ReadFromJsonFile <UnitSaveData>(filePath)); } return(null); }
public static ItemContainerSaveData LoadItems(string path) { string filePath = baseSavePath + "/" + path + ".json"; if (File.Exists(filePath)) { return(JSONReadWrite.ReadFromJsonFile <ItemContainerSaveData>(filePath)); } else if (File.Exists(firstPlayPathInventory)) { return(JSONReadWrite.ReadFromJsonFile <ItemContainerSaveData>(firstPlayPathInventory)); } return(null); }
public static Dictionary <string, UnitSaveData> LoadAllEnemyUnits(string path) { string filePath = Application.streamingAssetsPath + "/" + path + ".json"; if (File.Exists(filePath)) { return(JSONReadWrite.ReadFromJsonFile <Dictionary <string, UnitSaveData> >(filePath)); } else if (File.Exists(firstPlayPathUnit)) { Debug.Log("First play json used"); return(JSONReadWrite.ReadFromJsonFile <Dictionary <string, UnitSaveData> >(firstPlayPathUnit)); } return(null); }