From 62fe6be88cf1b996c4802ea921a5bc7d04748d37 Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 09:44:51 -0800 Subject: [PATCH 01/11] Create MRTK.Generated.sentinel --- .../Assets/MRTK.Generated/MRTK.Generated.sentinel | 0 .../Assets/MRTK.Generated/MRTK.Generated.sentinel.meta | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 UnityProjects/MRTKDevTemplate/Assets/MRTK.Generated/MRTK.Generated.sentinel create mode 100644 UnityProjects/MRTKDevTemplate/Assets/MRTK.Generated/MRTK.Generated.sentinel.meta diff --git a/UnityProjects/MRTKDevTemplate/Assets/MRTK.Generated/MRTK.Generated.sentinel b/UnityProjects/MRTKDevTemplate/Assets/MRTK.Generated/MRTK.Generated.sentinel new file mode 100644 index 000000000..e69de29bb diff --git a/UnityProjects/MRTKDevTemplate/Assets/MRTK.Generated/MRTK.Generated.sentinel.meta b/UnityProjects/MRTKDevTemplate/Assets/MRTK.Generated/MRTK.Generated.sentinel.meta new file mode 100644 index 000000000..174cbfd81 --- /dev/null +++ b/UnityProjects/MRTKDevTemplate/Assets/MRTK.Generated/MRTK.Generated.sentinel.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2402dd68deefc124ca12b591c71a7a05 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From ce2355419d22987f72b98bb8a027cb2e348093a1 Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 11:33:06 -0800 Subject: [PATCH 02/11] Create MRTKFiles --- .../Editor/MRTKFiles.cs | 93 +++++++++++++++++++ .../Editor/MRTKFiles.cs.meta | 11 +++ 2 files changed, 104 insertions(+) create mode 100644 org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs create mode 100644 org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs.meta diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs new file mode 100644 index 000000000..73bf8eefd --- /dev/null +++ b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs @@ -0,0 +1,93 @@ +// Copyright (c) Mixed Reality Toolkit Contributors +// Licensed under the BSD 3-Clause + +using System.IO; +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace MixedReality.Toolkit.Editor +{ + public class MRTKFiles + { + private const string GeneratedName = "MRTK.Generated"; + private const string GeneratedSentinelFileName = GeneratedName + ".sentinel"; + + private static readonly string DefaultGeneratedFolderPath = Path.Combine("Assets", GeneratedName); + private static readonly string DefaultSentinelFilePath = Path.Combine(DefaultGeneratedFolderPath, GeneratedSentinelFileName); + private static string generatedFolderPath = string.Empty; + + public static string GeneratedFolderPath + { + get + { + if (string.IsNullOrWhiteSpace(generatedFolderPath)) + { + foreach (string guid in AssetDatabase.FindAssets(GeneratedName)) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + if (path.Contains(GeneratedSentinelFileName)) + { + generatedFolderPath = Path.GetDirectoryName(path); + return generatedFolderPath; + } + } + + + //string[] filePathResults = Directory.GetFiles(Application.dataPath, GeneratedSentinelFileName, SearchOption.AllDirectories); + //if (filePathResults.Length > 0) + //{ + // generatedFolderPath = Path.GetDirectoryName(filePathResults[0]); + // if (filePathResults.Length > 1) + // { + // Debug.LogWarning($"{filePathResults.Length} MRTK.Generated sentinels were found.\nUsing the one in {generatedFolderPath}"); + // } + //} + //else + //{ + if (!Directory.Exists(DefaultGeneratedFolderPath)) + { + Directory.CreateDirectory(DefaultGeneratedFolderPath); + } + + if (!File.Exists(DefaultSentinelFilePath)) + { + // Make sure we create and dispose/close the filestream just created + using (FileStream f = File.Create(DefaultSentinelFilePath)) { } + } + generatedFolderPath = DefaultGeneratedFolderPath; + //} + } + return generatedFolderPath; + } + } + + private class AssetPostprocessor : UnityEditor.AssetPostprocessor + { + public static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) + { + foreach (string asset in deletedAssets.Concat(movedFromAssetPaths)) + { + if (Path.GetFileName(asset) == GeneratedSentinelFileName && Path.GetDirectoryName(asset) == generatedFolderPath) + { + generatedFolderPath = string.Empty; + } + } + + foreach (string asset in importedAssets.Concat(movedAssets)) + { + if (Path.GetFileName(asset) == GeneratedSentinelFileName) + { + string newPath = Path.GetDirectoryName(asset); + if (generatedFolderPath != string.Empty && generatedFolderPath != newPath) + { + Debug.LogWarning($"Previous MRTK.Generated folder was not unregistered properly: {generatedFolderPath}.\nReplacing with {newPath}"); + } + Debug.Log($"Found MRTK.Generated at {newPath}."); + generatedFolderPath = newPath; + } + } + } + } + } +} diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs.meta b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs.meta new file mode 100644 index 000000000..53ba7cceb --- /dev/null +++ b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec43400d20c14a248a30d6d4196d669e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 154738a378815063ba7fb23e9b4eb53f7ef6ad48 Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 11:33:15 -0800 Subject: [PATCH 03/11] Update MRTKSettings.cs --- org.mixedrealitytoolkit.core/Editor/MRTKSettings.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKSettings.cs b/org.mixedrealitytoolkit.core/Editor/MRTKSettings.cs index f3e86bae2..6dd07baea 100644 --- a/org.mixedrealitytoolkit.core/Editor/MRTKSettings.cs +++ b/org.mixedrealitytoolkit.core/Editor/MRTKSettings.cs @@ -14,8 +14,7 @@ namespace MixedReality.Toolkit.Editor [System.Serializable] public class MRTKSettings : ScriptableObject { - internal const string MRTKGeneratedFolder = "Assets/MRTK.Generated"; - internal const string MRTKSettingsPath = MRTKGeneratedFolder + "/MRTKSettings.asset"; + internal static string MRTKSettingsPath => Path.Combine(MRTKFiles.GeneratedFolderPath, "MRTKSettings.asset"); [SerializeField] private SerializableDictionary settings = new SerializableDictionary(); @@ -83,11 +82,6 @@ internal static MRTKSettings GetOrCreateSettings() var settings = AssetDatabase.LoadAssetAtPath(MRTKSettingsPath); if (settings == null) { - if (!Directory.Exists(MRTKGeneratedFolder)) - { - Directory.CreateDirectory(MRTKGeneratedFolder); - } - settings = CreateInstance(); AssetDatabase.CreateAsset(settings, MRTKSettingsPath); AssetDatabase.SaveAssets(); From 0d8d27086ff806555cb4e49fc69f6de2f09dcad2 Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 12:34:29 -0800 Subject: [PATCH 04/11] Update MRTKFiles.cs --- .../Editor/MRTKFiles.cs | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs index 73bf8eefd..bdaa1212c 100644 --- a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs +++ b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs @@ -33,30 +33,17 @@ public static string GeneratedFolderPath } } + if (!Directory.Exists(DefaultGeneratedFolderPath)) + { + Directory.CreateDirectory(DefaultGeneratedFolderPath); + } - //string[] filePathResults = Directory.GetFiles(Application.dataPath, GeneratedSentinelFileName, SearchOption.AllDirectories); - //if (filePathResults.Length > 0) - //{ - // generatedFolderPath = Path.GetDirectoryName(filePathResults[0]); - // if (filePathResults.Length > 1) - // { - // Debug.LogWarning($"{filePathResults.Length} MRTK.Generated sentinels were found.\nUsing the one in {generatedFolderPath}"); - // } - //} - //else - //{ - if (!Directory.Exists(DefaultGeneratedFolderPath)) - { - Directory.CreateDirectory(DefaultGeneratedFolderPath); - } - - if (!File.Exists(DefaultSentinelFilePath)) - { - // Make sure we create and dispose/close the filestream just created - using (FileStream f = File.Create(DefaultSentinelFilePath)) { } - } - generatedFolderPath = DefaultGeneratedFolderPath; - //} + if (!File.Exists(DefaultSentinelFilePath)) + { + // Make sure we create and dispose/close the filestream just created + using (FileStream f = File.Create(DefaultSentinelFilePath)) { } + } + generatedFolderPath = DefaultGeneratedFolderPath; } return generatedFolderPath; } From b76b9d7fb7eb3ff0f0391c019897fff837ff00f2 Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 12:57:51 -0800 Subject: [PATCH 05/11] Update hardcoded "MRTK.Generated" usages --- org.mixedrealitytoolkit.core/Editor/MRTKBuildPreferences.cs | 2 +- .../SubsystemWizard/SubsystemGenerator.cs | 4 ++-- .../SubsystemWizard/SubsystemWizardWindow.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKBuildPreferences.cs b/org.mixedrealitytoolkit.core/Editor/MRTKBuildPreferences.cs index 52dfa7f22..71c854372 100644 --- a/org.mixedrealitytoolkit.core/Editor/MRTKBuildPreferences.cs +++ b/org.mixedrealitytoolkit.core/Editor/MRTKBuildPreferences.cs @@ -51,7 +51,7 @@ private static SettingsProvider BuildPreferences() static void GUIHandler(string searchContext) { - EditorGUILayout.HelpBox("These settings are serialized into MRTKSettings.asset in the MRTK.Generated folder.\nThis file can be checked into source control to maintain consistent settings across collaborators.", MessageType.Info); + EditorGUILayout.HelpBox($"These settings are serialized into MRTKSettings.asset in {MRTKFiles.GeneratedFolderPath}.\nThis file can be checked into source control to maintain consistent settings across collaborators.", MessageType.Info); DrawAppLauncherModelField(); } diff --git a/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemGenerator.cs b/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemGenerator.cs index e23be5962..1366881d6 100644 --- a/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemGenerator.cs +++ b/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemGenerator.cs @@ -2,6 +2,7 @@ // Licensed under the BSD 3-Clause using Microsoft.CSharp; +using MixedReality.Toolkit.Editor; using System; using System.Collections.Generic; using System.IO; @@ -33,7 +34,6 @@ internal class SubsystemGenerator private const bool DefaultCreateConfiguration = false; private static readonly string DefaultBaseSubsystemName = $"NewSubsystem"; - private static readonly string OutputFolderRoot = Path.Combine("Assets", "MRTK.Generated"); [SerializeField] private SubsystemWizardState state = SubsystemWizardState.Start; @@ -159,7 +159,7 @@ public void Generate( { // Make sure there is a folder in which to create the new files. DirectoryInfo outputFolder = new DirectoryInfo( - Path.Combine(OutputFolderRoot, SubsystemName)); + Path.Combine(MRTKFiles.GeneratedFolderPath, SubsystemName)); if (!outputFolder.Exists) { outputFolder.Create(); diff --git a/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemWizardWindow.cs b/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemWizardWindow.cs index e6724334b..287925745 100644 --- a/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemWizardWindow.cs +++ b/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemWizardWindow.cs @@ -247,7 +247,7 @@ private void RenderWizardPreGeneratePage() } EditorGUILayout.LabelField( - $"The new subsystem will be created in your project's MRTK.Generated/{subsystemGenerator.SubsystemName} folder.", + $"The new subsystem will be created in your project's {Path.Combine(MRTKFiles.GeneratedFolderPath, subsystemGenerator.SubsystemName)} folder.", EditorStyles.boldLabel); EditorGUILayout.Space(6); @@ -345,7 +345,7 @@ private void RenderWizardCompletePage() { StringBuilder sb = new StringBuilder(); int step = 1; - sb.AppendLine($" {step}. In the Project view, navigate to Assets/MRTK.Generated/{subsystemGenerator.SubsystemName}"); + sb.AppendLine($" {step}. In the Project view, navigate to {Path.Combine(MRTKFiles.GeneratedFolderPath, subsystemGenerator.SubsystemName)}"); step++; sb.AppendLine($" {step}. Open {subsystemGenerator.DescriptorName}.cs"); step++; From 5d1f22f0b792f6862e0829edb256a33b8b3a4f77 Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 13:09:18 -0800 Subject: [PATCH 06/11] Update MRTKFiles.cs --- org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs index bdaa1212c..0a8c12999 100644 --- a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs +++ b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs @@ -41,7 +41,7 @@ public static string GeneratedFolderPath if (!File.Exists(DefaultSentinelFilePath)) { // Make sure we create and dispose/close the filestream just created - using (FileStream f = File.Create(DefaultSentinelFilePath)) { } + using FileStream f = File.Create(DefaultSentinelFilePath); } generatedFolderPath = DefaultGeneratedFolderPath; } From 44de5a96919fa21f0ef6426f00126ecabd1ba95c Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 14:07:01 -0800 Subject: [PATCH 07/11] Update MRTKFiles.cs --- org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs index 0a8c12999..f723922b3 100644 --- a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs +++ b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs @@ -66,12 +66,15 @@ public static void OnPostprocessAllAssets(string[] importedAssets, string[] dele if (Path.GetFileName(asset) == GeneratedSentinelFileName) { string newPath = Path.GetDirectoryName(asset); - if (generatedFolderPath != string.Empty && generatedFolderPath != newPath) + if (generatedFolderPath != newPath) { - Debug.LogWarning($"Previous MRTK.Generated folder was not unregistered properly: {generatedFolderPath}.\nReplacing with {newPath}"); + if (generatedFolderPath != string.Empty) + { + Debug.LogWarning($"Previous MRTK.Generated folder was not unregistered properly: {generatedFolderPath}.\nReplacing with {newPath}"); + } + Debug.Log($"Found MRTK.Generated at {newPath}."); + generatedFolderPath = newPath; } - Debug.Log($"Found MRTK.Generated at {newPath}."); - generatedFolderPath = newPath; } } } From 4d7e3bc57fadf05878de8ed97724dfe5711a529d Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 14:11:48 -0800 Subject: [PATCH 08/11] Update MRTKFiles.cs --- org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs index f723922b3..3d02fc8ac 100644 --- a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs +++ b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs @@ -58,6 +58,7 @@ public static void OnPostprocessAllAssets(string[] importedAssets, string[] dele if (Path.GetFileName(asset) == GeneratedSentinelFileName && Path.GetDirectoryName(asset) == generatedFolderPath) { generatedFolderPath = string.Empty; + break; } } @@ -72,9 +73,10 @@ public static void OnPostprocessAllAssets(string[] importedAssets, string[] dele { Debug.LogWarning($"Previous MRTK.Generated folder was not unregistered properly: {generatedFolderPath}.\nReplacing with {newPath}"); } - Debug.Log($"Found MRTK.Generated at {newPath}."); + Debug.Log($"Found MRTK.Generated sentinel at {newPath}."); generatedFolderPath = newPath; } + break; } } } From b06ba676466e4ac4008b38f2cbc54a36fb871381 Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 14:20:47 -0800 Subject: [PATCH 09/11] Property to method and docs --- .../Editor/MRTKBuildPreferences.cs | 2 +- .../Editor/MRTKFiles.cs | 50 +++++++++++-------- .../Editor/MRTKSettings.cs | 2 +- .../SubsystemWizard/SubsystemGenerator.cs | 2 +- .../SubsystemWizard/SubsystemWizardWindow.cs | 4 +- 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKBuildPreferences.cs b/org.mixedrealitytoolkit.core/Editor/MRTKBuildPreferences.cs index 71c854372..106c75f9b 100644 --- a/org.mixedrealitytoolkit.core/Editor/MRTKBuildPreferences.cs +++ b/org.mixedrealitytoolkit.core/Editor/MRTKBuildPreferences.cs @@ -51,7 +51,7 @@ private static SettingsProvider BuildPreferences() static void GUIHandler(string searchContext) { - EditorGUILayout.HelpBox($"These settings are serialized into MRTKSettings.asset in {MRTKFiles.GeneratedFolderPath}.\nThis file can be checked into source control to maintain consistent settings across collaborators.", MessageType.Info); + EditorGUILayout.HelpBox($"These settings are serialized into MRTKSettings.asset in {MRTKFiles.GetOrCreateGeneratedFolderPath()}.\nThis file can be checked into source control to maintain consistent settings across collaborators.", MessageType.Info); DrawAppLauncherModelField(); } diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs index 3d02fc8ac..47f21a5d5 100644 --- a/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs +++ b/org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs @@ -8,6 +8,9 @@ namespace MixedReality.Toolkit.Editor { + /// + /// Provides helper methods for accessing MRTK-defined files and folders. + /// public class MRTKFiles { private const string GeneratedName = "MRTK.Generated"; @@ -17,38 +20,43 @@ public class MRTKFiles private static readonly string DefaultSentinelFilePath = Path.Combine(DefaultGeneratedFolderPath, GeneratedSentinelFileName); private static string generatedFolderPath = string.Empty; - public static string GeneratedFolderPath + /// + /// Finds the current MRTK.Generated folder based on the sentinel file. If a sentinel file is not found, + /// a new MRTK.Generated folder and sentinel are created and this new path is returned. + /// + /// The AssetDatabase-compatible path to the MRTK.Generated folder. + public static string GetOrCreateGeneratedFolderPath() { - get + if (string.IsNullOrWhiteSpace(generatedFolderPath)) { - if (string.IsNullOrWhiteSpace(generatedFolderPath)) + foreach (string guid in AssetDatabase.FindAssets(GeneratedName)) { - foreach (string guid in AssetDatabase.FindAssets(GeneratedName)) + string path = AssetDatabase.GUIDToAssetPath(guid); + if (path.Contains(GeneratedSentinelFileName)) { - string path = AssetDatabase.GUIDToAssetPath(guid); - if (path.Contains(GeneratedSentinelFileName)) - { - generatedFolderPath = Path.GetDirectoryName(path); - return generatedFolderPath; - } + generatedFolderPath = Path.GetDirectoryName(path); + return generatedFolderPath; } + } - if (!Directory.Exists(DefaultGeneratedFolderPath)) - { - Directory.CreateDirectory(DefaultGeneratedFolderPath); - } + if (!Directory.Exists(DefaultGeneratedFolderPath)) + { + Directory.CreateDirectory(DefaultGeneratedFolderPath); + } - if (!File.Exists(DefaultSentinelFilePath)) - { - // Make sure we create and dispose/close the filestream just created - using FileStream f = File.Create(DefaultSentinelFilePath); - } - generatedFolderPath = DefaultGeneratedFolderPath; + if (!File.Exists(DefaultSentinelFilePath)) + { + // Make sure we create and dispose/close the filestream just created + using FileStream f = File.Create(DefaultSentinelFilePath); } - return generatedFolderPath; + generatedFolderPath = DefaultGeneratedFolderPath; } + return generatedFolderPath; } + /// + /// Checks for an existing MRTK.Generated sentinel file on asset import. Allows the path to be pre-cached before use. + /// private class AssetPostprocessor : UnityEditor.AssetPostprocessor { public static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) diff --git a/org.mixedrealitytoolkit.core/Editor/MRTKSettings.cs b/org.mixedrealitytoolkit.core/Editor/MRTKSettings.cs index 6dd07baea..64e3d85c0 100644 --- a/org.mixedrealitytoolkit.core/Editor/MRTKSettings.cs +++ b/org.mixedrealitytoolkit.core/Editor/MRTKSettings.cs @@ -14,7 +14,7 @@ namespace MixedReality.Toolkit.Editor [System.Serializable] public class MRTKSettings : ScriptableObject { - internal static string MRTKSettingsPath => Path.Combine(MRTKFiles.GeneratedFolderPath, "MRTKSettings.asset"); + internal static string MRTKSettingsPath => Path.Combine(MRTKFiles.GetOrCreateGeneratedFolderPath(), "MRTKSettings.asset"); [SerializeField] private SerializableDictionary settings = new SerializableDictionary(); diff --git a/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemGenerator.cs b/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemGenerator.cs index 1366881d6..ea9295bfb 100644 --- a/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemGenerator.cs +++ b/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemGenerator.cs @@ -159,7 +159,7 @@ public void Generate( { // Make sure there is a folder in which to create the new files. DirectoryInfo outputFolder = new DirectoryInfo( - Path.Combine(MRTKFiles.GeneratedFolderPath, SubsystemName)); + Path.Combine(MRTKFiles.GetOrCreateGeneratedFolderPath(), SubsystemName)); if (!outputFolder.Exists) { outputFolder.Create(); diff --git a/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemWizardWindow.cs b/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemWizardWindow.cs index 287925745..c3b72de75 100644 --- a/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemWizardWindow.cs +++ b/org.mixedrealitytoolkit.tools/SubsystemWizard/SubsystemWizardWindow.cs @@ -247,7 +247,7 @@ private void RenderWizardPreGeneratePage() } EditorGUILayout.LabelField( - $"The new subsystem will be created in your project's {Path.Combine(MRTKFiles.GeneratedFolderPath, subsystemGenerator.SubsystemName)} folder.", + $"The new subsystem will be created in your project's {Path.Combine(MRTKFiles.GetOrCreateGeneratedFolderPath(), subsystemGenerator.SubsystemName)} folder.", EditorStyles.boldLabel); EditorGUILayout.Space(6); @@ -345,7 +345,7 @@ private void RenderWizardCompletePage() { StringBuilder sb = new StringBuilder(); int step = 1; - sb.AppendLine($" {step}. In the Project view, navigate to {Path.Combine(MRTKFiles.GeneratedFolderPath, subsystemGenerator.SubsystemName)}"); + sb.AppendLine($" {step}. In the Project view, navigate to {Path.Combine(MRTKFiles.GetOrCreateGeneratedFolderPath(), subsystemGenerator.SubsystemName)}"); step++; sb.AppendLine($" {step}. Open {subsystemGenerator.DescriptorName}.cs"); step++; From 3b57732eaa5d6358a42c18546f311858e39d148c Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 9 Jan 2025 16:28:38 -0800 Subject: [PATCH 10/11] Update CHANGELOG and version --- org.mixedrealitytoolkit.core/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.mixedrealitytoolkit.core/CHANGELOG.md b/org.mixedrealitytoolkit.core/CHANGELOG.md index d9da38446..9ba3a8598 100644 --- a/org.mixedrealitytoolkit.core/CHANGELOG.md +++ b/org.mixedrealitytoolkit.core/CHANGELOG.md @@ -10,7 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Added -* Added event `OnSpeechRecognitionKeywordChanged` to allow UI updates when the speech recognition keyword has changed. [PR #792](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/792/) +* Added event `OnSpeechRecognitionKeywordChanged` to allow UI updates when the speech recognition keyword has changed. [PR #792](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/792) +* Added support for moving the MRTK.Generated folder around the project's Assets folder structure instead of enforcing a root location. [PR #969](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/969) ### Fixed @@ -39,8 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). * Added IsProximityHovered property of type TimedFlag to detect when a button starts being hovered or on interactor proximity and when it stops being hovered or on proximity of any interactor. [PR #611](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/611) * Adding ProximityHover events (Entered & Exited) to PressableButton class. [PR #611](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/611) - ### Fixed * Fixed support for UPM package publishing in the Unity Asset Store. [PR #519](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/519) -* Fix warning and event triggered on disabled StatefulInteractable after changing speech settings [PR #591](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/591) [PR #608](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/608) \ No newline at end of file +* Fix warning and event triggered on disabled StatefulInteractable after changing speech settings [PR #591](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/591) [PR #608](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/608) From 89343effd77e2a84f731a796ee177cd7d9efeb5c Mon Sep 17 00:00:00 2001 From: Kurtis Date: Mon, 13 Jan 2025 16:45:03 -0800 Subject: [PATCH 11/11] Update Tools dependency on Core --- UnityProjects/MRTKDevTemplate/Packages/packages-lock.json | 2 +- org.mixedrealitytoolkit.tools/CHANGELOG.md | 6 ++++++ org.mixedrealitytoolkit.tools/package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Packages/packages-lock.json b/UnityProjects/MRTKDevTemplate/Packages/packages-lock.json index ce075f1d1..798300b97 100644 --- a/UnityProjects/MRTKDevTemplate/Packages/packages-lock.json +++ b/UnityProjects/MRTKDevTemplate/Packages/packages-lock.json @@ -400,7 +400,7 @@ "depth": 0, "source": "local", "dependencies": { - "org.mixedrealitytoolkit.core": "3.2.2" + "org.mixedrealitytoolkit.core": "3.3.0" } }, "org.mixedrealitytoolkit.uxcomponents": { diff --git a/org.mixedrealitytoolkit.tools/CHANGELOG.md b/org.mixedrealitytoolkit.tools/CHANGELOG.md index 136ff5ea9..71939c84c 100644 --- a/org.mixedrealitytoolkit.tools/CHANGELOG.md +++ b/org.mixedrealitytoolkit.tools/CHANGELOG.md @@ -2,6 +2,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## Unreleased + +### Changed + +* Updated MRTK Core Definitions dependency to 3.3.0. [PR #969](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/969) + ## [3.0.5] - 2025-11-12 ### Fixed diff --git a/org.mixedrealitytoolkit.tools/package.json b/org.mixedrealitytoolkit.tools/package.json index 9bcb37a38..6266be34f 100644 --- a/org.mixedrealitytoolkit.tools/package.json +++ b/org.mixedrealitytoolkit.tools/package.json @@ -17,6 +17,6 @@ "unityRelease": "26f1", "documentationUrl": "https://www.mixedrealitytoolkit.org", "dependencies": { - "org.mixedrealitytoolkit.core": "3.2.2" + "org.mixedrealitytoolkit.core": "3.3.0" } } \ No newline at end of file