Search Unity

XR plug-in management by script

Discussion in 'Scripting' started by keil_unity, Apr 9, 2021.

  1. keil_unity

    keil_unity

    Joined:
    Mar 2, 2021
    Posts:
    28
    hey all im currently creating a command line build and i need to manually turn on Arkit within the xr-plugin management package. It seems the code to do this though is not a public method so i am at a loss of how to do it this outside of the editor? what i currently have is
    Code (CSharp):
    1.             string arkitPackage = "com.unity.xr.arkit";
    2.  
    3.             var buildTargetSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(BuildTargetGroup.iOS);
    4.             var pluginsSettings = buildTargetSettings.AssignedSettings;
    5.             var didAssign = XRPackageMetadataStore.AssignLoader(pluginsSettings, arkitPackage, BuildTargetGroup.iOS);
    6.  
    7.             if (!didAssign)
    8.             {
    9.                 throw new System.Exception($"didAssign broke please check package exists {arkitPackage}");
    10.  
    11.             }
    but it throws errors because I have not told the plug-in manager how to load it yet ie this toggle here in the ui
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,726
    keil_unity likes this.