Developer Setup

Project Setup

Follow the Building CollabXR guide to get the initial Unity project set up.

Playtesting

Setting Developer Preferences

In order to minimize interference with other developers while testing, we heavily advise setting your default room via Developer Preferences. The “default room” is the lobby you enter when you press “Connect” on the main menu without adding a lobby ID or scanning a QR Code.

To do this, first hit Play using the arrow at the top of the screen. This should automatically create an asset at Assets/Resources/Preferences/DeveloperPreferences.asset. Stop the play mode, then change the “Default Room” field on that asset to something unique.

You can optionally create a QR Code using the provided button, in order to create a print out you can scan at any time. The developer preferences only apply while testing in editor.

Testing in Editor with the Simulator

To simulate a Quest environment, we use the Meta XR Simulator, which must be downloaded from their site. We typically use the QuestDebug Build Profile for testing both in-editor and outside of the editor, since it is the primary platform we develop for.

Once everything is installed, launch the Meta XR Simulator and re-open the Unity project. You should see a MetaXR simulator icon near the Play button. Click it so it turns blue.

../_images/metaxr_simulator_arm.png

Open the Assets/Scenes/Menu.unity scene, and then press Play. This should drop you in the main menu for CollabXR. Press “Connect” to enter into your configured default room. After connecting to a lobby, you can press B to open the spawn menu and tool selector. You may need to disable one of the simulated controllers using the Open Inputs > Global Input Settings in order to open or interact with menus.

Testing in Headset

Build an APK using the QuestDebug Build Profile. You may need to install the Meta Quest Developer Hub to load the build onto a Quest headset.

Continuous Integration

Consistent, clean, and readable code is important when making contributions in order to reduce friction between developers. While not required, installing these tools and adhering to code style guidelines is strongly recommended for a streamlined PR review process.

DotNet

We recommended .NET SDK version 10, but anything support by .NET Standard 2.1 should be okay, although some tools like CSharpier may not work with older SDK versions.

  1. Ensure the proper dotnet version is installed: $ dotnet --version

  2. In the root directory of the CollabXR repository, install the dotnet tool manifest: $ dotnet tool restore

  3. Install corresponding plugins for your IDE as necessary (CSharpier plugin list)

Most IDEs support “format on save” operations, see IDE specific setup. If not automatically handled by your IDE, you can format using CSharpier at any time: $ dotnet csharpier .

Pre-Commit Hooks

pre-commit is used for formatting fixes and validation before making commits and pushing them. Their documentation provides a recommended installation method.

Note

If you’re working on Debian, pre-commit can be installed globally via apt: $ sudo apt install pre-commit

Once pre-commit is installed on your system, you can set it up within the root directory of the CollabXR repository: $ pre-commit install

Now, any time you make a commit, pre-commit should fix any formatting or whitespace issues before the commit is made. If any issues arise, pre-commit will abort the commit, allowing you to add changes before committing again.

Note

If you’re using GitHub Desktop, you may need to use the beta version for proper commit hooks support (if it works). Or, we recommend using an alternative GUI client like GitKraken (free version).