Example #1
0
    public static UnitSaveData LoadUnit(string path)
    {
        string filePath = baseSavePath + "/" + path + ".json";

        if (File.Exists(filePath))
        {
            return(JSONReadWrite.ReadFromJsonFile <UnitSaveData>(filePath));
        }
        return(null);
    }
Example #2
0
    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);
    }
Example #3
0
    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);
    }