Skip to content

Commit 48cc5c2

Browse files
authored
Update RemoveHelper.cs
some fixes
1 parent 89be9af commit 48cc5c2

1 file changed

Lines changed: 21 additions & 10 deletions

File tree

Assets/BidMachine/Editor/RemoveHelper.cs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#pragma warning disable 0649
1+
#pragma warning disable 0649
22
using System.IO;
33
using UnityEditor;
44
using System.Text.RegularExpressions;
55
using UnityEngine;
6-
// using System.Collections.Generic;
6+
using System.Collections.Generic;
77
using System.Diagnostics.CodeAnalysis;
88
// using System.Linq;
99

@@ -28,19 +28,30 @@ public static void RemovePlugin(bool isCleanBeforeUpdate = false)
2828
"Yes",
2929
"Cancel"))
3030
{
31-
32-
FileUtil.DeleteFileOrDirectory(Path.Combine(Application.dataPath, "Plugins/Android"));
33-
FileUtil.DeleteFileOrDirectory(Path.Combine(Application.dataPath, "Plugins/iOS"));
3431
FileUtil.DeleteFileOrDirectory(Path.Combine(Application.dataPath, "BidMachine"));
35-
36-
FileUtil.DeleteFileOrDirectory(Path.Combine(Application.dataPath, "Plugins/Android" + ".meta"));
37-
FileUtil.DeleteFileOrDirectory(Path.Combine(Application.dataPath, "Plugins/iOS" + ".meta"));
3832
FileUtil.DeleteFileOrDirectory(Path.Combine(Application.dataPath, "BidMachine" + ".meta"));
33+
34+
35+
new List<string>(Directory.GetFiles("Assets/Plugins/iOS")).ForEach(file => {
36+
Regex re = new Regex("bidmachine", RegexOptions.IgnoreCase);
37+
if (re.IsMatch(file))
38+
File.Delete(file);
39+
File.Delete(file + ".meta");
40+
});
41+
new List<string>(Directory.GetFiles("Assets/Plugins/Android")).ForEach(file => {
42+
Regex re = new Regex("bidmachine", RegexOptions.IgnoreCase);
43+
if (re.IsMatch(file))
44+
File.Delete(file);
45+
File.Delete(file + ".meta");
46+
});
47+
48+
Directory.Delete("Assets/Plugins/Android/bidmachine.androidlib", true);
49+
}
3950

4051
AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate);
4152

42-
}
4353
}
4454

4555
}
46-
}
56+
57+
}

0 commit comments

Comments
 (0)