Skip to content

Commit

Permalink
Save modified WebXR settings asset
Browse files Browse the repository at this point in the history
  • Loading branch information
bnco-dev committed Apr 9, 2024
1 parent 517de1d commit 5887e14
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ static void Update()
PackageManagerHelper.RequireSample("com.de-panther.webxr-interactions","XR Interaction Toolkit Sample");

#if !UBIQ_DISABLE_WEBXRAUTOLOADOFF
var modified = false;
var settings = WebXRSettings.GetSettings();
if (settings != null && settings.AutoLoadWebXRInputSystem)
{
modified = true;
settings.AutoLoadWebXRInputSystem = false;
Debug.Log("Ubiq has set AutoLoadWebXRInputSystem to FALSE" +
" in the WebXR settings. This is to allow you to build" +
Expand All @@ -67,6 +69,7 @@ static void Update()
}
if (settings != null && settings.AutoLoadWebXRManager)
{
modified = true;
settings.AutoLoadWebXRManager = false;
Debug.Log("Ubiq has set AutoLoadWebXRManager to FALSE" +
" in the WebXR settings. This is to allow you to build" +
Expand All @@ -75,6 +78,11 @@ static void Update()
" behaviour, add the string UBIQ_DISABLE_WEBXRAUTOLOADOFF" +
" to your scripting define symbols.");
}
if (modified)
{
EditorUtility.SetDirty(settings);
AssetDatabase.SaveAssetIfDirty(settings);
}
#endif
#endif

Expand Down

0 comments on commit 5887e14

Please sign in to comment.