diff --git a/Packages/Tracking/CHANGELOG.md b/Packages/Tracking/CHANGELOG.md index 427555357..6b5cf0b6b 100644 --- a/Packages/Tracking/CHANGELOG.md +++ b/Packages/Tracking/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated Copyright year to 2025 - Split tracking preview examples into different groups - common assets, main examples and examples that need the old input manager to work (e.g. UI input) - (Service Provider) Expose service IP and port as user settable variables +- Removed option to disable BiRP->URP upgrade on a per user basis for non-Windows machines as it's not supported. ### Fixed - Fixed some warnings around runtime variables that were only used in editor mode diff --git a/Packages/Tracking/Core/Runtime/Scripts/UltraleapSettings.cs b/Packages/Tracking/Core/Runtime/Scripts/UltraleapSettings.cs index 5fd39688f..a0c0212ab 100644 --- a/Packages/Tracking/Core/Runtime/Scripts/UltraleapSettings.cs +++ b/Packages/Tracking/Core/Runtime/Scripts/UltraleapSettings.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using UnityEngine; +using System.Runtime.InteropServices; #if UNITY_EDITOR using UnityEditor; @@ -160,20 +161,24 @@ private static void NotificationSection(SerializedObject settings) private static void RenderPipelineSupportSection(SerializedObject settings) { - EditorGUILayout.LabelField("Render Pipeline Support", EditorStyles.boldLabel); - EditorGUILayout.Space(5); - - using (new EditorGUI.IndentLevelScope()) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - // Enable automatic upgrades - UltraleapSettings.AutomaticallyUpgradeMaterialsToCurrentRenderPipeline = - EditorGUILayout.ToggleLeft("Enable automatic updates of the Ultraleap plugin materials to the active render pipeline on this machine.", UltraleapSettings.AutomaticallyUpgradeMaterialsToCurrentRenderPipeline); - EditorGUILayout.TextArea("Note: if set to false, this setting will persist across ALL Unity projects that use the plugin. You can still manually force the upgrade."); - } + EditorGUILayout.LabelField("Render Pipeline Support", EditorStyles.boldLabel); + EditorGUILayout.Space(5); - EditorGUILayout.Space(30); + using (new EditorGUI.IndentLevelScope()) + { - settings.ApplyModifiedProperties(); + // Enable automatic upgrades + UltraleapSettings.AutomaticallyUpgradeMaterialsToCurrentRenderPipeline = + EditorGUILayout.ToggleLeft("Enable automatic updates of the Ultraleap plugin materials to the active render pipeline on this machine.", UltraleapSettings.AutomaticallyUpgradeMaterialsToCurrentRenderPipeline); + EditorGUILayout.TextArea("Note: if set to false, this setting will persist across ALL Unity projects that use the plugin. You can still manually force the upgrade."); + } + + EditorGUILayout.Space(30); + + settings.ApplyModifiedProperties(); + } } private static void ResetSection(SerializedObject settings) @@ -238,20 +243,31 @@ public static bool AutomaticallyUpgradeMaterialsToCurrentRenderPipeline { get { - string readValue = System.Environment.GetEnvironmentVariable(automaticallyUpgradeMaterialsToCurrentRenderPipelineEnvironmentVariableName, EnvironmentVariableTarget.User); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + string readValue = System.Environment.GetEnvironmentVariable(automaticallyUpgradeMaterialsToCurrentRenderPipelineEnvironmentVariableName, EnvironmentVariableTarget.User); + + if (string.IsNullOrEmpty(readValue)) + { + AutomaticallyUpgradeMaterialsToCurrentRenderPipeline = defaultValueForAutomaticallyUpgradingMaterialsForActiveRenderPipeline; + return defaultValueForAutomaticallyUpgradingMaterialsForActiveRenderPipeline; + } - if (string.IsNullOrEmpty(readValue)) + return Convert.ToBoolean(readValue); + } + else { - AutomaticallyUpgradeMaterialsToCurrentRenderPipeline = defaultValueForAutomaticallyUpgradingMaterialsForActiveRenderPipeline; - return defaultValueForAutomaticallyUpgradingMaterialsForActiveRenderPipeline; + return true; } - - return Convert.ToBoolean(readValue); } set { - System.Environment.SetEnvironmentVariable(automaticallyUpgradeMaterialsToCurrentRenderPipelineEnvironmentVariableName, Convert.ToString(value), EnvironmentVariableTarget.User); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + // Setting user scoped environment variables is only supported on Windows + System.Environment.SetEnvironmentVariable(automaticallyUpgradeMaterialsToCurrentRenderPipelineEnvironmentVariableName, Convert.ToString(value), EnvironmentVariableTarget.User); + } } }