Editor Scripting: How to edit XR Plug-In provider by script?
Asked Answered
A

3

0

Hi!
I’m trying to edit the information showed in the picture below using an editor script but I can’t find any documentation on this.

How to toggle Plugin-In providers?

Thank you.

Abode answered 18/3 at 7:28 Comment(0)
E
0

Hi @Abode , I’m stuck with the same problem, did you manage to solve it?

Thank you!

Elodiaelodie answered 6/6, 2023 at 2:36 Comment(2)

for me the script i put up works fine on the camera but i have not tried putting it in a 'first person controller'. As for the mouse are you asking to make it stop moving your character, in which case you can just find that part of the script and delete it. Or you can hide the mouse but if it is going to be used for click then this would be useless (i don't understand what you mean by disable)

Philosophize

so if you want to stop moving the camera with the mouse you will have to find that part of the script and get rid of (sorry still not quite sure what your asking the mouse to do). P.S did the script i posted work in the end or are you still having problems (if your using the character control script it gives it might be that it is already using a code to move forward, backwards and side-to-side and this part of it might also need to be deleted)

Philosophize
K
0

Edit :

Found the answer here : https://forum.unity.com/threads/editor-programmatically-set-the-vr-system-in-xr-plugin-management.972285/

Here is what I’m using now :

XRGeneralSettingsPerBuildTarget buildTargetSettings = null;
EditorBuildSettings.TryGetConfigObject(XRGeneralSettings.k_SettingsKey, out buildTargetSettings);
XRGeneralSettings settings = buildTargetSettings.SettingsForBuildTarget(BuildTargetGroup.Android);
  
XRPackageMetadataStore.RemoveLoader(settings.Manager, "Unity.XR.Oculus.OculusLoader", BuildTargetGroup.Android);
XRPackageMetadataStore.AssignLoader(settings.Manager, "Unity.XR.WaveXR.WaveXRLoader", BuildTargetGroup.Android);
Keyte answered 18/3 at 7:30 Comment(2)

Thank you very much! It worked perfectly :)

Elodiaelodie

For completeness, the code above references the following namespaces using UnityEditor.XR.Management; using UnityEditor.XR.Management.Metadata; using UnityEngine.XR.Management;

Nikolia
G
0

Hi, can anybody tell how to set the feature group in the openxr loader? For instance switching Meta Quest feature group and pico xr feature group in the build pipeline via script?

Grozny answered 18/3 at 5:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.