public void Import(ScriptableObject scriptableObject) { if (this.settings == null) { return; } string file = ImportExportHelper.PersistentPath(scriptableObject.name + ".json"); if (this.settings.CustomDirectory) { string source = ImportExportHelper.AbsolutePath(this.settings.DirectoryPath, scriptableObject.name + ".json"); ImportExportHelper.CopyFile(source, file); } if (ImportExportHelper.ExistsFile(file)) { string json = ImportExportHelper.ImportFile(file); JsonUtility.FromJsonOverwrite(json, scriptableObject); LogNow(ImportExportLogType.Import, scriptableObject); } else { Export(scriptableObject); } }
public void ImportManually(ScriptableObject scriptableObject, string file) { string json = ImportExportHelper.ImportFile(file); JsonUtility.FromJsonOverwrite(json, scriptableObject); LogNow(ImportExportLogType.ImportManually, scriptableObject); WriteLogAndClear(); }