VisionOS Settings Device Target Set Method Removed

The latest com.unity.xr.visionos package removed the VisionOSSettings.SetDeviceTargetAndUpdateRenderMode method from the VisioinOSSettings class. We have a custom build process that updates various settings prior to starting a build and had implemented the use of this method in our build configuration setups to configure a VR vs. MR build. Is there an equivalent method somewhere I am missing or could we get it added back in?

Hey OwlchemyDawson :wave:

Let me do some digging on my end and I’ll get back to you.

1 Like

Hey there! Indeed, VisionOSSettings.SetDeviceTargetAndUpdateRenderMode was removed after the 0.1 version of com.unity.xr.visionos. In its absence, you can just set VisionOSSettings.deviceTarget and VisionOSSettings.renderMode directly on their public properties, as well as VisionOSSettings.appMode to switch between MR and VR mode.

Note that these properties cannot be changed at runtime in the Player.

Also, the renderMode setting is still dependent on deviceTarget. For Simulator builds, you must use multi-pass, and for Device builds, you must use single-pass.

These settings will be updated in the future to simplify this workflow.

1 Like

@mtschoen The deviceTarget property does not have a setter; only a getter.

Ah, you’re right. My mistake. I think you can safely ignore the device target setting for now. If you really need to change it, you should be able to use the SerializedObject API to modify the property in the settings asset. For now, it might be best to manually change the setting in the UI before running the build.

Sorry for the inconvenience. We’ll make sure to expose this properly though C# in a future update.

2 Likes