Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Import SteamVR by leveraging Package Manager's git capability #1113

Open
JaXt0r opened this issue Jun 6, 2024 · 0 comments

Comments

@JaXt0r
Copy link

JaXt0r commented Jun 6, 2024

Following up on #962

Unity's way of packaging dependencies/plugins via git Package Manager is a great way to keep source code separate from package code. https://docs.unity3d.com/Manual/upm-git.html
There are only three changes to SteamVR neccessary to work with this approach:

  1. Have a package.json
  2. (optionally?) rearrance folders to match common examples (e.g. https://github.com/VRMADA/ultimatexr-unity)
  3. Do not create files inside PackageCache folder (where the downloaded packages belong to)

Current behaviour

I put the SteamVR unitypackage files in my own repository and added a package.json file. In my Unity project, I added the reference to this repository in my manifest.json.
Now, if SteamVR is integrated into a Unity project via Package Manager and its git capabilities, it fails with errors as it wants to create folders on top of PackageCache/SteamVR (like PackageCache/SteamVR_Input). The SteamVR plugin itself isn't capable of handling this new behaviour and should look inside /Assets/SteamVR_Input instead.
image

Couldn't create asset file!
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Valve.VR.SteamVR_Settings:LoadInstance () (at ./Library/PackageCache/com.valvesoftware.unity.steamvr@a0fb60ed97/Scripts/SteamVR_Settings.cs:113)
Valve.VR.SteamVR_Settings:get_instance () (at ./Library/PackageCache/com.valvesoftware.unity.steamvr@a0fb60ed97/Scripts/SteamVR_Settings.cs:18)
Valve.VR.SteamVR_Input:CheckOldLocation () (at ./Library/PackageCache/com.valvesoftware.unity.steamvr@a0fb60ed97/Input/SteamVR_Input.cs:1312)
Valve.VR.SteamVR_CopyExampleInputFiles:Update () (at ./Library/PackageCache/com.valvesoftware.unity.steamvr@a0fb60ed97/Input/Editor/SteamVR_CopyExampleInputFiles.cs:26)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
UnityException: Creating asset at path Library\PackageCache\SteamVR_Resources\Resources\SteamVR_Settings.asset failed.
Valve.VR.SteamVR_Settings.LoadInstance () (at ./Library/PackageCache/com.valvesoftware.unity.steamvr@a0fb60ed97/Scripts/SteamVR_Settings.cs:113)
Valve.VR.SteamVR_Settings.get_instance () (at ./Library/PackageCache/com.valvesoftware.unity.steamvr@a0fb60ed97/Scripts/SteamVR_Settings.cs:18)
Valve.VR.SteamVR_Input.CheckOldLocation () (at ./Library/PackageCache/com.valvesoftware.unity.steamvr@a0fb60ed97/Input/SteamVR_Input.cs:1312)
Valve.VR.SteamVR_CopyExampleInputFiles.Update () (at ./Library/PackageCache/com.valvesoftware.unity.steamvr@a0fb60ed97/Input/Editor/SteamVR_CopyExampleInputFiles.cs:26)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <e21ef1ad5a5e4c73a2048dac84671e33>:0)

Expected behaviour

SteamVR plugin should have a package.json file and slightly altered file creation logic to become usable via Package Managers git capabilities.

Further references

People on this repository already mentioned a few workarounds, but I couldn't get it to run due to inconsitencies:

  1. Possible fix Fix Unity crash on "Open binding UI" when using as package #491 --> Unfortunately not all changes (especially on SteamVR_Settings.cs) were ported to the beta release 2.8.x
  2. Same mitigation but still not working as not officially supported by SteamVR plugin: Release plugin as a set of Unity Package Manager packages #626 (comment)
  3. [Feature Request] Add package.json and add compatibility with unity package manager #962 - Three years ago, someone already mentioned the package.json way. It got declined as it wasn't Unity standard back in the days. Now the dependency way is standard.
  4. UltimateXR: A project which can be officially integrated via git references as it leverages package.json approach (https://github.com/VRMADA/ultimatexr-unity)
  5. SteamVR's included bundle of OpenVR already leverages package.json (Once .tar.gz is uncompressed, you can put it on a git repository and reference it in manifest.json for Package Manager)

It would be great if we can have a working version to integrate SteamVR into Package Manager for better usability of the plugin.

@JaXt0r JaXt0r changed the title [Feature Request] Import SteamVR by leveraging Package Managers git capability [Feature Request] Import SteamVR by leveraging Package Manager's git capability Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant