Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Question How can i exclude all OpenXR and XR Interaction Toolkit stuff from some builds ?

Discussion in 'VR' started by Deathtreak, Mar 7, 2023.

  1. Deathtreak

    Deathtreak

    Joined:
    Nov 19, 2017
    Posts:
    17
    Hi,

    I'm wondering, how can i exclude OpenXR and XR Interaction Toolkit stuff from a project.
    In my case, i would like to build my project with and without VR support, but i dont know how to easily isolate VR stuff.
    My fear is that, some VR stuff will be integrated in Android build for exemple, and i dont need it on Android, only on Windows PC.
    How can i achieve separation ? Do i only need to have some specific initialization scenes and prefabs depending on plateforms i want to build, and unity will do the job in it's side ?
     
  2. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    101
    Hey,

    For OpenXR provider, you can simply uncheck / unselect it in the XR Plugin management UI for the platforms(e.g. Android if you don't need it). Then openxr package won't be included in the build.
     
  3. Deathtreak

    Deathtreak

    Joined:
    Nov 19, 2017
    Posts:
    17
    Hello again,

    Sorry for the delay, i didn't had time to test out.
    I made two build, one with OpenXR ticked in XR Plugin Management and one with OpenXR not ticked in XR Plugin Management
    The build size is quite the same and in mybuild/mybuild_Data/Managed i have all dll and pdb related to XR in both build :/
    I also tried building with an empty scene, just in case, and there's still all XR dll and pdb packed in project build
    Could it be because i have the XR Interaction Toolkit in my project and it force Unity to export OpenXR dependencies in builds ?