Skip to content

Commit 7f5e800

Browse files
committed
Update MRTKFiles.cs
1 parent a2a3507 commit 7f5e800

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

org.mixedrealitytoolkit.core/Editor/MRTKFiles.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static string GeneratedFolderPath
4141
if (!File.Exists(DefaultSentinelFilePath))
4242
{
4343
// Make sure we create and dispose/close the filestream just created
44-
using (FileStream f = File.Create(DefaultSentinelFilePath)) { }
44+
using FileStream f = File.Create(DefaultSentinelFilePath);
4545
}
4646
generatedFolderPath = DefaultGeneratedFolderPath;
4747
}
@@ -58,6 +58,7 @@ public static void OnPostprocessAllAssets(string[] importedAssets, string[] dele
5858
if (Path.GetFileName(asset) == GeneratedSentinelFileName && Path.GetDirectoryName(asset) == generatedFolderPath)
5959
{
6060
generatedFolderPath = string.Empty;
61+
break;
6162
}
6263
}
6364

@@ -66,12 +67,16 @@ public static void OnPostprocessAllAssets(string[] importedAssets, string[] dele
6667
if (Path.GetFileName(asset) == GeneratedSentinelFileName)
6768
{
6869
string newPath = Path.GetDirectoryName(asset);
69-
if (generatedFolderPath != string.Empty && generatedFolderPath != newPath)
70+
if (generatedFolderPath != newPath)
7071
{
71-
Debug.LogWarning($"Previous MRTK.Generated folder was not unregistered properly: {generatedFolderPath}.\nReplacing with {newPath}");
72+
if (generatedFolderPath != string.Empty)
73+
{
74+
Debug.LogWarning($"Previous MRTK.Generated folder was not unregistered properly: {generatedFolderPath}.\nReplacing with {newPath}");
75+
}
76+
Debug.Log($"Found MRTK.Generated sentinel at {newPath}.");
77+
generatedFolderPath = newPath;
7278
}
73-
Debug.Log($"Found MRTK.Generated at {newPath}.");
74-
generatedFolderPath = newPath;
79+
break;
7580
}
7681
}
7782
}

0 commit comments

Comments
 (0)