@@ -356,40 +356,6 @@ public static bool InstallMaya(bool verbose = false)
356
356
}
357
357
}
358
358
359
- class IntegrationsUI
360
- {
361
- /// <summary>
362
- /// The path of the Maya executable.
363
- /// </summary>
364
- public static string GetMayaExe ( ) {
365
- return FbxExporters . EditorTools . ExportSettings . GetSelectedMayaPath ( ) ;
366
- }
367
-
368
- public static void InstallMayaIntegration ( )
369
- {
370
- var mayaExe = GetMayaExe ( ) ;
371
- if ( string . IsNullOrEmpty ( mayaExe ) ) {
372
- return ;
373
- }
374
-
375
- if ( ! Integrations . InstallMaya ( verbose : true ) ) {
376
- return ;
377
- }
378
-
379
- int exitCode = Integrations . ConfigureMaya ( mayaExe ) ;
380
-
381
- string title , message ;
382
- if ( exitCode != 0 ) {
383
- title = "Failed to install Maya Integration." ;
384
- message = string . Format ( "Failed to configure Maya, please check logs (exitcode={0})." , exitCode ) ;
385
- } else {
386
- title = "Completed installation of Maya Integration." ;
387
- message = "Enjoy the new \" Unity\" menu in Maya." ;
388
- }
389
- UnityEditor . EditorUtility . DisplayDialog ( title , message , "Ok" ) ;
390
- }
391
- }
392
-
393
359
class MaxIntegration
394
360
{
395
361
private const string MaxScriptsPath = "FbxExporters/Integrations/Autodesk/max/scripts/" ;
@@ -478,22 +444,52 @@ public static int InstallMaxPlugin(){
478
444
}
479
445
return ExitCode ;
480
446
}
481
-
482
447
}
483
448
484
- class MaxIntegrationUI {
485
- public static void InstallIntegration ( )
486
- {
487
- int exitCode = MaxIntegration . InstallMaxPlugin ( ) ;
449
+ class IntegrationsUI
450
+ {
451
+ /// <summary>
452
+ /// The path of the Maya executable.
453
+ /// </summary>
454
+ public static string GetMayaExe ( ) {
455
+ return FbxExporters . EditorTools . ExportSettings . GetSelectedMayaPath ( ) ;
456
+ }
457
+
458
+ /// <summary>
459
+ /// Opens a dialog showing whether the installation succeeded.
460
+ /// </summary>
461
+ /// <param name="dcc">Dcc name.</param>
462
+ private static void ShowSuccessDialog ( string dcc , int exitCode ) {
488
463
string title , message ;
489
464
if ( exitCode != 0 ) {
490
- title = "Failed to install 3DsMax Integration." ;
491
- message = string . Format ( "Failed to configure 3DsMax , please check logs (exitcode={0 })." , exitCode ) ;
465
+ title = string . Format ( "Failed to install {0} Integration." , dcc ) ;
466
+ message = string . Format ( "Failed to configure {0} , please check logs (exitcode={1 })." , dcc , exitCode ) ;
492
467
} else {
493
- title = "Completed installation of 3DsMax Integration." ;
494
- message = "Enjoy the new Unity menu in 3DsMax." ;
468
+ title = string . Format ( "Completed installation of {0} Integration." , dcc ) ;
469
+ message = string . Format ( "Enjoy the new Unity menu in {0}." , dcc ) ;
495
470
}
496
471
UnityEditor . EditorUtility . DisplayDialog ( title , message , "Ok" ) ;
497
472
}
473
+
474
+ public static void InstallMayaIntegration ( )
475
+ {
476
+ var mayaExe = GetMayaExe ( ) ;
477
+ if ( string . IsNullOrEmpty ( mayaExe ) ) {
478
+ return ;
479
+ }
480
+
481
+ if ( ! Integrations . InstallMaya ( verbose : true ) ) {
482
+ return ;
483
+ }
484
+
485
+ int exitCode = Integrations . ConfigureMaya ( mayaExe ) ;
486
+ ShowSuccessDialog ( "Maya" , exitCode ) ;
487
+ }
488
+
489
+ public static void InstallMaxIntegration ( )
490
+ {
491
+ int exitCode = MaxIntegration . InstallMaxPlugin ( ) ;
492
+ ShowSuccessDialog ( "3DsMax" , exitCode ) ;
493
+ }
498
494
}
499
495
}
0 commit comments