/// <summary> /// Load an object from disk /// </summary> /// <param name="type">Type of object to be loaded</param> /// <param name="filename">Name of file to load object from</param> /// <param name="folder">Name of folder containing the file to be loaded</param> /// <returns>Instance of object to be loaded. Null if file did not exist.</returns> public object Load(Type type, string filename, string folder = null) { if (string.IsNullOrEmpty(folder)) { folder = defaultFolder; } var saveLoadMethod = GetSaveLoadMethod(saveMethod); return(SaveLoadUtility.Load(type, saveLoadMethod, filename, folder, baseFolder)); }
/// <summary> /// Load object from file and specify the method of save/load /// </summary> /// <param name="methodType">Method to be used to save the file to disk.</param> /// <param name="filename">Name of file to be read from.</param> /// <param name="folder">Name of the folder containing the file.</param> /// <typeparam name="T">Type of object to be loaded from the file.</typeparam> /// <returns>Object instance loaded from file. Null if file does not exist or load failed.</returns> public object LoadWithMethod(SerializationMethodType methodType, Type type, string filename, string folder = null) { var saveLoadMethod = GetSaveLoadMethod(methodType); return(SaveLoadUtility.Load(type, saveLoadMethod, filename, folder)); }