@@ -506,9 +506,22 @@ class IntegrationsUI
506
506
const string MenuItemName1 = "FbxExporters/Install Maya Integration" ;
507
507
const string IntegrationZipPath = "FbxExporters/unityoneclick_for_maya.zip" ;
508
508
509
+ private static string DefaultIntegrationSavePath = Application . dataPath ;
510
+ private static string LastIntegrationSavePath = DefaultIntegrationSavePath ;
511
+
509
512
[ MenuItem ( MenuItemName1 , false , 0 ) ]
510
513
public static void OnMenuItem1 ( )
511
514
{
515
+ // prompt user to enter location to unzip file
516
+ var unzipFolder = EditorUtility . OpenFolderPanel ( "Select Location to Save Maya Integration" , LastIntegrationSavePath , "" ) ;
517
+ Debug . Log ( unzipFolder ) ;
518
+
519
+ // check that this is a valid location to unzip the file
520
+
521
+
522
+ // if file already unzipped in this location, then prompt user
523
+ // if they would like to continue unzipping or use what is there
524
+
512
525
// unzip Integration folder
513
526
DecompressZip ( Application . dataPath + "/" + IntegrationZipPath , Application . dataPath + "/TestIntegrations" ) ;
514
527
return ;
@@ -531,6 +544,21 @@ public static void OnMenuItem1 ()
531
544
UnityEditor . EditorUtility . DisplayDialog ( title , message , "Ok" ) ;
532
545
}
533
546
547
+ private static bool hasWriteAccessToFolder ( string folderPath )
548
+ {
549
+ try
550
+ {
551
+ // Attempt to get a list of security permissions from the folder.
552
+ // This will raise an exception if the path is read only or do not have access to view the permissions.
553
+ System . Security . AccessControl . DirectorySecurity ds = System . IO . Directory . GetAccessControl ( folderPath ) ;
554
+ return true ;
555
+ }
556
+ catch ( UnauthorizedAccessException )
557
+ {
558
+ return false ;
559
+ }
560
+ }
561
+
534
562
public static void DecompressZip ( string zipPath , string destPath ) {
535
563
System . Diagnostics . Process myProcess = new System . Diagnostics . Process ( ) ;
536
564
myProcess . StartInfo . FileName = string . Format ( "\" {0}\" " , EditorApplication . applicationContentsPath + "/Tools/7z.exe" ) ;
0 commit comments