Skip to content
JaXt0r edited this page Dec 3, 2025 · 25 revisions

Welcome to the uuvr wiki!

Dumping some ideas in here.

First versions where xyz is supported:

Games and tests

Version Game Status
5.4.3p3 (Mono) Yooka-Laylee First Unity minor version (5.4.x) which supports VR. SteamVR is officially not yet released for it (Starting with 5.4.6). HMD Projection works partially (didn't test in detail). Input system: Rewired (not Input.GetButton()).
2020.3.9f1 (Mono) I Am Fish HDRP, redirecting Canvas in main menu not working...

Unity version - special needs

Unity 5.4.3p3 (Yooka-Laylee)

  • No UnityEngine.VRModule.dll exists so far.
  • Need to compile against stripped UnityEngine.dll from this version.
  • SteamVR version 2.6.1 needed (newer versions are referencing UnityEngine.XR namespace which is included in UnityEngine.VRModule.dll earliest)

(deprecated idea) System architecture

Note

Challenging my idea at the Flat2VR Discord Server showed me, that I thought too complex and the general legacy-modern approach is sufficient. Skipping this Loader idea for now.

As we want to support a wide range of Unity and versions, we need to enhance our system architecture to keep up with complexity.

1. Multiple Unity versions might need different ways on how to set a feature or general API calls.
Handled via one Implementation source code base which is separated by #ifdef pragmas for specific needs

2. Unity changed .net versions over years (.net35, .net47, .net60)
For Mono, we stick with first version (.net35) for il2cpp too (.net60). C# provides backward compatibility and therefore only modern language features or possible improvements are missed (.net48), but it reduces .dll version complexity.

3. Unity has two backends being used: Mono + IL2CPP
As both have general different usage e.g. for a MonoBehavior constructur, we need to compile for both options (Starting from Unity version which supports IL2CPP)

4. Different Unity versions are compatible with different 3rd party dependencies
e.g., SteamVR unity package needs to be used in a separate version for Unity 5.x. We therefore need to reference the correct one at build time and load it at runtime.

5. Additional 3rd party frameworks used by a game, might need special handling
e.g., Rewired input framework ignoring Unity's Input.GetButton() feature and needs special treatment. Selectively load it at runtime and call it's logic.
Why not putting it into UUVR.Implementation: As we always compile against stripped .dlls from actual game directories, we need to ensure, that a person without any game and this plugin can compile and run UUVR on their development environment.

The following dll loading structure will handle each case:

/
├─ UUVR.Patcher/            # Execute pre-runtime logic like copying XR dlls into Unity Plugin folder.
├─ UUVR.Loader/             # Load implementations based on Unity version and backend
├─ UUVR.Implementation/     # Implementation of general and Unity specific code. Separated by #ifdef pragmas.
|  ├─ namespace UUVR.Core
|  ├─ namespace UUVR.Camera
|  ├─ namespace UUVR.Input
|  ├─ namespace UUVR.Util
|  ├─ ...
├─ UUVR.SteamVR-2.6.1/      # Some legacy Unity versions need a different SteamVR version
├─ UUVR.SteamVR-2.8.5/
├─ UUVR.SteamVR-2.8.5/
├─ UUVR.Rewired/            # Special handling for some Game specific needs and logic.

Based on Unity version and backend needs, we will have the following DLLs compiled:

patcher/
├─ UUVR
|  ├─ UUVR.Patcher.dll                     # Possibility to copy different .dlls for general XR additional to Unity's Plugins/ folder.
plugins/
├─ UUVR
│  ├─ UUVR.Loader.Mono.NET35.dll           # Contains general BepInEx plugin logic (different for each backend type)
│  ├─ UUVR.Loader.IL2CPP.NET60.dll
│  ├─ implementation
│  │  ├─ UUVR.Mono.543p3.dll               # Unity version + backend specific compilations
│  │  ├─ UUVR.Mono.2019xx.dll
│  │  ├─ UUVR.Mono.6xx.dll
│  │  ├─ UUVR.IL2CPP.6xx.dll
│  ├─ tools
│  │  ├─ UUVR.SteamVR.2.6.1.dll            # Unity 5.4-5.6 needs a different SteamVR version.
│  │  ├─ UUVR.SteamVR.latest.dll
│  ├─ game-plugins
│  │  ├─ UUVR.Rewired.dll                  # Some games might need special handling. Load this logic based on game configuration.    

Loading

Testing strategy

To ensure the different versions of Unity and its backends are tested (at least compile time), loading of libs also changes:

  1. Each major Unity version loads specific stripped Unity-*.dlls
  2. For CI, there will be an additional repository where these .dlls reside
  3. A build-all test script can be leveraged to test it locally too

Example:

Build UUVR.Mono.5.dll -> Use build time dependencies at /lib/Mono/5/*
UUVR.Mono.2019.dll    -> Use build time dependencies at /lib/Mono/2019/*
UUVR.Mono.6.dll       -> Use build time dependencies at /lib/Mono/6/*
UUVR.IL2CPP.6.dll     -> Use build time dependencies at /lib/IL2CPP/6/*