diff --git a/UnitySaveSystem/SaveFile.cs b/UnitySaveSystem/SaveFile.cs deleted file mode 100644 index 12b8273..0000000 --- a/UnitySaveSystem/SaveFile.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.IO; -using UnityEngine; - -namespace UnitySaveSystem -{ - public class SaveFile - { - public readonly string JsonFilePath; - public readonly string SaveFolderPath; - - private SaveFileClassesManager saveClassesManager; - - public T LoadClass() - { - return JsonUtility.FromJson(File.ReadAllText(JsonFilePath)); - } - - public void SaveClass(T classToSave) - { - saveClassesManager.AddClass(classToSave); - } - - public SaveFile(string pathToSave, string saveName) - { - SaveFolderPath = pathToSave + saveName; - JsonFilePath = SaveFolderPath + saveName + ".json"; - if (Directory.Exists(JsonFilePath) == false) - { - Directory.CreateDirectory(SaveFolderPath); - File.Create(pathToSave).Close(); - saveClassesManager = new SaveFileClassesManager(SaveFolderPath); - } - else - { - throw new System.Exception("Save file with the same name already exists"); - } - } - } -} diff --git a/UnitySaveSystem/SaveFileClassesManager.cs b/UnitySaveSystem/SaveFileClassesManager.cs deleted file mode 100644 index fe83e5b..0000000 --- a/UnitySaveSystem/SaveFileClassesManager.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using UnityEngine; - -namespace UnitySaveSystem -{ - class SaveFileClassesManager - { - private List _classesSavePath = new List(); - private readonly string _saveFolderPath; - - public void AddClass(T classToSave) - { - if (Directory.Exists(_saveFolderPath) == false) - Directory.CreateDirectory(Path.Combine(_saveFolderPath, classToSave.ToString() + ".json")); - - var classPath = Path.Combine(_saveFolderPath, classToSave.ToString() + ".json"); - File.AppendAllText(classPath, JsonUtility.ToJson(classToSave)); - _classesSavePath.Add(classPath); - } - - public T GetClass() - where T : new() - { - T Type = new T(); - string classType = Type.ToString(); - - var classPath = Path.Combine(_saveFolderPath, classType.ToString() + ".json"); - return JsonUtility.FromJson(File.ReadAllText(classPath)); - } - - public void RemoveClass(T classToRemove) - { - if (Directory.Exists(_saveFolderPath) == false) - throw new System.Exception("Save file with this name does not exist"); - - - if (_classesSavePath.Remove(Path.Combine(_saveFolderPath, classToRemove.ToString() + ".json")) == false) - throw new System.Exception("Save file with this name does not exist"); - } - - public SaveFileClassesManager(string saveFolderPath) - { - _saveFolderPath = Path.Combine(saveFolderPath, "classes"); - } - } -} \ No newline at end of file diff --git a/UnitySaveSystem/SaveFileClassesManager1.cs b/UnitySaveSystem/SaveFileClassesManager1.cs deleted file mode 100644 index 9c6718f..0000000 --- a/UnitySaveSystem/SaveFileClassesManager1.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using UnityEngine; - -namespace UnitySaveSystem -{ - class SaveFileClassesManager - { - private List _classesSavePath = new List(); - private string _saveFolderPath; - - public void AddClass(T classToSave) - { - if (Directory.Exists(_saveFolderPath) == false) - Directory.CreateDirectory(_saveFolderPath); - - var classPath = Path.Combine(_saveFolderPath, classToSave.ToString() + ".json"); - File.AppendAllText(classPath, JsonUtility.ToJson(classToSave)); - _classesSavePath.Add(classPath); - } - - public void RemoveClass(T classToRemove) - { - - } - - public SaveFileClassesManager(string saveFolderPath) - { - _saveFolderPath = Path.Combine(saveFolderPath, "classes"); - } - } -} diff --git a/UnitySaveSystem/UnitySaveSystem.cs b/UnitySaveSystem/UnitySaveSystem.cs deleted file mode 100644 index 9e26572..0000000 --- a/UnitySaveSystem/UnitySaveSystem.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UnityEngine; -using System.IO; - -namespace UnitySaveSystem -{ - public class UnitySaveSystem : MonoBehaviour - { - public void GetSavesFileFromFolder(string path) - { - var files = Directory.GetFiles(path, "*.json"); - } - } - - -} diff --git a/UnitySaveSystem/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/UnitySaveSystem/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs deleted file mode 100644 index 3871b18..0000000 --- a/UnitySaveSystem/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs +++ /dev/null @@ -1,4 +0,0 @@ -// -using System; -using System.Reflection; -[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/UnitySaveSystem/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/UnitySaveSystem/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index 7bc3f58..0000000 Binary files a/UnitySaveSystem/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ diff --git a/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.AssemblyReference.cache b/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.AssemblyReference.cache deleted file mode 100644 index a70e3ef..0000000 Binary files a/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.AssemblyReference.cache and /dev/null differ diff --git a/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.CopyComplete b/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.CopyComplete deleted file mode 100644 index e69de29..0000000 diff --git a/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.CoreCompileInputs.cache b/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.CoreCompileInputs.cache deleted file mode 100644 index 5398df7..0000000 --- a/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.CoreCompileInputs.cache +++ /dev/null @@ -1 +0,0 @@ -c998f8f37228a2cd538b61dda27c355359501816 diff --git a/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.FileListAbsolute.txt b/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.FileListAbsolute.txt deleted file mode 100644 index f2a3124..0000000 --- a/UnitySaveSystem/obj/Debug/UnitySaveSystem.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,7 +0,0 @@ -E:\GitProject\FPS\Assets\Plugins\UnitySaveSystem.dll -E:\GitProject\FPS\Assets\Plugins\UnitySaveSystem.pdb -E:\GitProject\SaveSystem\UnitySaveSystem\obj\Debug\UnitySaveSystem.csproj.AssemblyReference.cache -E:\GitProject\SaveSystem\UnitySaveSystem\obj\Debug\UnitySaveSystem.csproj.CoreCompileInputs.cache -E:\GitProject\SaveSystem\UnitySaveSystem\obj\Debug\UnitySaveSystem.csproj.CopyComplete -E:\GitProject\SaveSystem\UnitySaveSystem\obj\Debug\UnitySaveSystem.dll -E:\GitProject\SaveSystem\UnitySaveSystem\obj\Debug\UnitySaveSystem.pdb diff --git a/UnitySaveSystem/obj/Debug/UnitySaveSystem.dll b/UnitySaveSystem/obj/Debug/UnitySaveSystem.dll deleted file mode 100644 index 8fd5874..0000000 Binary files a/UnitySaveSystem/obj/Debug/UnitySaveSystem.dll and /dev/null differ diff --git a/UnitySaveSystem/obj/Debug/UnitySaveSystem.pdb b/UnitySaveSystem/obj/Debug/UnitySaveSystem.pdb deleted file mode 100644 index 810f507..0000000 Binary files a/UnitySaveSystem/obj/Debug/UnitySaveSystem.pdb and /dev/null differ