Commit f3a496dc authored by SherryChaos's avatar SherryChaos

delete pictures when exporting is over

parent fc68c3f3
...@@ -8,6 +8,8 @@ namespace MDPro3 ...@@ -8,6 +8,8 @@ namespace MDPro3
{ {
public class PortHelper public class PortHelper
{ {
static List<string> filesToDelete = new List<string>();
public static void ImportFiles() public static void ImportFiles()
{ {
#if UNITY_ANDROID && !UNITY_EDITOR #if UNITY_ANDROID && !UNITY_EDITOR
...@@ -44,8 +46,7 @@ namespace MDPro3 ...@@ -44,8 +46,7 @@ namespace MDPro3
#if UNITY_ANDROID && !UNITY_EDITOR #if UNITY_ANDROID && !UNITY_EDITOR
NativeFilePicker.ExportMultipleFiles(filePaths, ExportResult); NativeFilePicker.ExportMultipleFiles(filePaths, ExportResult);
if(!copy) if(!copy)
foreach(var file in filePaths) filesToDelete = filePaths.ToList();
File.Delete(file);
#else #else
StandaloneFileBrowser.OpenFolderPanelAsync(InterString.Get("请选择导出目录"), "", false, (string[] paths) => StandaloneFileBrowser.OpenFolderPanelAsync(InterString.Get("请选择导出目录"), "", false, (string[] paths) =>
{ {
...@@ -159,7 +160,12 @@ namespace MDPro3 ...@@ -159,7 +160,12 @@ namespace MDPro3
static void ExportResult(bool sucess) static void ExportResult(bool sucess)
{ {
if (sucess) if (sucess)
{
MessageManager.Cast(InterString.Get("导出成功。")); MessageManager.Cast(InterString.Get("导出成功。"));
foreach(var file in filesToDelete)
File.Delete(file);
filesToDelete.Clear();
}
else else
MessageManager.Cast(InterString.Get("导出失败。")); MessageManager.Cast(InterString.Get("导出失败。"));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment