Skip to content

Commit 5887e14

Browse files
committed
Save modified WebXR settings asset
1 parent 517de1d commit 5887e14

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Unity/Assets/Ubiq/Samples/Player (XRI + WebXR)/Scripts/Editor/AddPackagesWebXR.cs

+8
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ static void Update()
5454
PackageManagerHelper.RequireSample("com.de-panther.webxr-interactions","XR Interaction Toolkit Sample");
5555

5656
#if !UBIQ_DISABLE_WEBXRAUTOLOADOFF
57+
var modified = false;
5758
var settings = WebXRSettings.GetSettings();
5859
if (settings != null && settings.AutoLoadWebXRInputSystem)
5960
{
61+
modified = true;
6062
settings.AutoLoadWebXRInputSystem = false;
6163
Debug.Log("Ubiq has set AutoLoadWebXRInputSystem to FALSE" +
6264
" in the WebXR settings. This is to allow you to build" +
@@ -67,6 +69,7 @@ static void Update()
6769
}
6870
if (settings != null && settings.AutoLoadWebXRManager)
6971
{
72+
modified = true;
7073
settings.AutoLoadWebXRManager = false;
7174
Debug.Log("Ubiq has set AutoLoadWebXRManager to FALSE" +
7275
" in the WebXR settings. This is to allow you to build" +
@@ -75,6 +78,11 @@ static void Update()
7578
" behaviour, add the string UBIQ_DISABLE_WEBXRAUTOLOADOFF" +
7679
" to your scripting define symbols.");
7780
}
81+
if (modified)
82+
{
83+
EditorUtility.SetDirty(settings);
84+
AssetDatabase.SaveAssetIfDirty(settings);
85+
}
7886
#endif
7987
#endif
8088

0 commit comments

Comments
 (0)