66using Microsoft . MixedReality . Toolkit . Utilities . Editor ;
77using System ;
88using System . Collections . Generic ;
9+ using System . IO ;
910using System . Reflection ;
1011using System . Text ;
1112using System . Threading . Tasks ;
@@ -255,7 +256,8 @@ public string SampleCode
255256
256257 #region static
257258
258- private static readonly string DefaultExtensionsFolderName = "MixedRealityToolkit.Extensions" ;
259+ private static readonly string DefaultGeneratedFolderName = "MixedRealityToolkit.Generated" ;
260+ private static readonly string DefaultExtensionsFolderName = "Extensions" ;
259261 private static readonly string DefaultExtensionNamespace = "Microsoft.MixedReality.Toolkit.Extensions" ;
260262 private static readonly string PersistentStateKey = "MRTK_ExtensionServiceWizard_State_Before_Recompilation" ;
261263 private static readonly string ScriptExtension = ".cs" ;
@@ -273,7 +275,7 @@ public string SampleCode
273275
274276 #region paths
275277
276- private string ExtensionsFolder => MixedRealityToolkitFiles . MapModulePath ( MixedRealityToolkitModuleType . Extensions ) ;
278+ private string ExtensionsFolder => Path . Combine ( "Assets" , DefaultGeneratedFolderName , DefaultExtensionsFolderName ) ;
277279 private string ServiceTemplatePath => MixedRealityToolkitFiles . MapRelativeFilePath ( MixedRealityToolkitModuleType . Tools , "ExtensionServiceCreator/Templates/ExtensionScriptTemplate.txt" ) ;
278280 private string InspectorTemplatePath => MixedRealityToolkitFiles . MapRelativeFilePath ( MixedRealityToolkitModuleType . Tools , "ExtensionServiceCreator/Templates/ExtensionInspectorTemplate.txt" ) ;
279281 private string InterfaceTemplatePath => MixedRealityToolkitFiles . MapRelativeFilePath ( MixedRealityToolkitModuleType . Tools , "ExtensionServiceCreator/Templates/ExtensionInterfaceTemplate.txt" ) ;
@@ -413,7 +415,13 @@ public bool ValidateAssets(List<string> errors)
413415
414416 if ( ! AssetDatabase . IsValidFolder ( ExtensionsFolder ) )
415417 {
416- AssetDatabase . CreateFolder ( "Assets" , DefaultExtensionsFolderName ) ;
418+ var generatedFolder = Path . Combine ( "Assets" , DefaultGeneratedFolderName ) ;
419+ if ( ! AssetDatabase . IsValidFolder ( generatedFolder ) )
420+ {
421+ AssetDatabase . CreateFolder ( "Assets" , DefaultGeneratedFolderName ) ;
422+ }
423+
424+ AssetDatabase . CreateFolder ( generatedFolder , DefaultExtensionsFolderName ) ;
417425 AssetDatabase . Refresh ( ) ;
418426 }
419427
@@ -803,4 +811,4 @@ private static Type FindServiceType(string serviceClassName)
803811
804812 #endregion
805813 }
806- }
814+ }
0 commit comments