1- #pragma warning disable 0649
1+ #pragma warning disable 0649
22using System . IO ;
33using UnityEditor ;
44using System . Text . RegularExpressions ;
55using UnityEngine ;
6- // using System.Collections.Generic;
6+ using System . Collections . Generic ;
77using 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