Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Creating an XR Provider: Operation Failed

Discussion in 'VR' started by michaeldodisgr_unity, Sep 12, 2022.

  1. michaeldodisgr_unity

    michaeldodisgr_unity

    Joined:
    May 23, 2018
    Posts:
    1
    Hello, I don't know if my question belongs to this specific discussion, but let me know and I can move it elsewhere.

    I'm trying to create a custom XR provider and have followed what little information is available regarding that (mostly from here). I created a simple DLL that calls "RegisterLifecycleProvider" when the plugin is loaded:

    Code (CSharp):
    1.  
    2.     UnityLifecycleProvider display_lifecycle_provider =  {
    3.         this,
    4.         lc_initialize,
    5.         lc_start,
    6.         lc_stop,
    7.         lc_shutdown,
    8.     };
    9.  
    10.     auto ret = xrdisplay->RegisterLifecycleProvider(
    11.         Plugin::KName,
    12.         Plugin::KMainDisplayName,
    13.         &display_lifecycle_provider);
    14.  
    This results in "kUnitySubsystemErrorCodeFailure", which means (according to the documentation of the interface) that no "UnitySubsystemsManifest.json" file was found that matched the display id and the name strings. I triple-checked, and the names do match, but initialization still fails so I assumed that Unity isn't able to find the manifest file inside the custom package, but I still haven't managed to resolve this.

    For reference, here's my package's folder structure:
    Code (CSharp):
    1. com.redacted.xr.pluginname
    2. │   Editor.meta
    3. │   package.json
    4. │   package.json.meta
    5. │   Runtime.meta
    6. ├───Editor
    7. │       com.redacted.xr.pluginname.Editor.asmdef
    8. │       com.redacted.xr.pluginname.Editor.asmdef.meta
    9. │       Metadata.cs
    10. │       Metadata.cs.meta
    11. └───Runtime
    12.         BuildSettings.cs
    13.         BuildSettings.cs.meta
    14.         com.redacted.xr.pluginname.asmdef
    15.         com.redacted.xr.pluginname.asmdef.meta
    16.         UnitySubsystemsManifest.json
    17.         UnitySubsystemsManifest.json.meta
    18.         the-xr-provider.dll
    19.         the-xr-provider.dll.meta
    20.         XRLoader.cs
    21.         XRLoader.cs.meta
    22.         XRSettings.cs
    23.         XRSettings.cs.meta
    This structure pretty much matches other xr providers I found on Github (like OpenVR, or Google Cardboard).

    Any ideas as to what might have gone wrong?