diff --git a/XRTK-Core/Packages/com.xrtk.core/Editor/MixedRealityPreferences.cs b/XRTK-Core/Packages/com.xrtk.core/Editor/MixedRealityPreferences.cs
index c4d419275..53a2b1c76 100644
--- a/XRTK-Core/Packages/com.xrtk.core/Editor/MixedRealityPreferences.cs
+++ b/XRTK-Core/Packages/com.xrtk.core/Editor/MixedRealityPreferences.cs
@@ -184,7 +184,7 @@ public static string SymbolicLinkSettingsPath
string.IsNullOrEmpty(symbolicLinkSettingsPath))
{
symbolicLinkSettingsPath = AssetDatabase
- .FindAssets($"t:{typeof(SymbolicLinkSettings).Name}")
+ .FindAssets($"t:{nameof(SymbolicLinkSettings)}")
.Select(AssetDatabase.GUIDToAssetPath)
.OrderBy(x => x)
.FirstOrDefault();
diff --git a/XRTK-Core/Packages/com.xrtk.core/Editor/Utilities/SymbolicLinks/SymbolicLink.cs b/XRTK-Core/Packages/com.xrtk.core/Editor/Utilities/SymbolicLinks/SymbolicLink.cs
index 7b5dea8c2..06dded5cb 100644
--- a/XRTK-Core/Packages/com.xrtk.core/Editor/Utilities/SymbolicLinks/SymbolicLink.cs
+++ b/XRTK-Core/Packages/com.xrtk.core/Editor/Utilities/SymbolicLinks/SymbolicLink.cs
@@ -33,7 +33,14 @@ public string TargetRelativePath
public bool IsActive
{
get => isActive;
- internal set => isActive = value;
+ set
+ {
+ if (isActive != value)
+ {
+ isActive = value;
+ SymbolicLinker.RunSync(true);
+ }
+ }
}
}
}
\ No newline at end of file
diff --git a/XRTK-Core/Packages/com.xrtk.core/Editor/Utilities/SymbolicLinks/SymbolicLinker.cs b/XRTK-Core/Packages/com.xrtk.core/Editor/Utilities/SymbolicLinks/SymbolicLinker.cs
index 139957465..f505ce1ba 100644
--- a/XRTK-Core/Packages/com.xrtk.core/Editor/Utilities/SymbolicLinks/SymbolicLinker.cs
+++ b/XRTK-Core/Packages/com.xrtk.core/Editor/Utilities/SymbolicLinks/SymbolicLinker.cs
@@ -15,7 +15,7 @@
namespace XRTK.Editor.Utilities.SymbolicLinks
{
[InitializeOnLoad]
- internal static class SymbolicLinker
+ public static class SymbolicLinker
{
///
/// Constructor.
@@ -48,7 +48,7 @@ static SymbolicLinker()
///
/// Debug the symbolic linker utility.
///
- public static bool DebugEnabled
+ private static bool DebugEnabled
{
get => MixedRealityPreferences.DebugSymbolicInfo;
set => MixedRealityPreferences.DebugSymbolicInfo = value;
@@ -128,16 +128,10 @@ public static void RunSync(bool forceUpdate = false)
{
if (string.IsNullOrEmpty(link.SourceRelativePath)) { continue; }
- bool isValid = false;
var targetAbsolutePath = $"{ProjectRoot}{link.TargetRelativePath}";
var sourceAbsolutePath = $"{ProjectRoot}{link.SourceRelativePath}";
- if (link.IsActive)
- {
- isValid = VerifySymbolicLink(targetAbsolutePath);
- }
-
- if (isValid)
+ if (VerifySymbolicLink(targetAbsolutePath))
{
// If we already have the directory in our project, then skip.
if (link.IsActive) { continue; }
@@ -202,7 +196,7 @@ public static void RunSync(bool forceUpdate = false)
///
///
///
- public static bool AddLink(string sourceAbsolutePath, string targetAbsolutePath)
+ internal static bool AddLink(string sourceAbsolutePath, string targetAbsolutePath)
{
if (string.IsNullOrEmpty(sourceAbsolutePath) || string.IsNullOrEmpty(targetAbsolutePath))
{
@@ -256,7 +250,7 @@ public static bool AddLink(string sourceAbsolutePath, string targetAbsolutePath)
/// Disables a symbolic link in the settings.
///
///
- public static bool DisableLink(string targetRelativePath)
+ internal static bool DisableLink(string targetRelativePath)
{
var symbolicLink = Settings.SymbolicLinks.Find(link => link.TargetRelativePath == targetRelativePath);
@@ -282,7 +276,7 @@ public static bool DisableLink(string targetRelativePath)
///
///
///
- public static bool RemoveLink(string sourceRelativePath, string targetRelativePath)
+ internal static bool RemoveLink(string sourceRelativePath, string targetRelativePath)
{
if (!DisableLink(targetRelativePath))
{