Skip to content

Feature/improve mac os urp upgrade workflow #1694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Packages/Tracking/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
52 changes: 34 additions & 18 deletions Packages/Tracking/Core/Runtime/Scripts/UltraleapSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.InteropServices;

#if UNITY_EDITOR
using UnityEditor;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
}
}

Expand Down