This section provides an overview of the project structure and its key elements.
To maintain readability and understanding, we have established a coding standard for the entire project. We use the dotnet format Unity-Discover.sln function to apply the appropriate formatting during development. The specific rules are defined in the .editorconfig, Unity-Discover.sln.DotSettings, and Assembly-CSharp.csproj.DotSettings files.
The project is organized by asset type for easy navigation. However, internal applications like DroneRage and MRBike have their own structures, which we will discuss later. While most directories are self-explanatory, we will highlight some of interest.
This directory contains configurations related to Discover, including scriptable objects for App Manifests and the App List.
- App List: A list of manifests used in the project, linked to various scripts on prefabs. This setup allows easy modification without code changes and simplifies access logic.
- App Manifests: These contain the necessary information to set up applications in the project, including data on icons, 3D icons, placement, names, and prefabs for launching applications.
-
Main Scene: Discover.unity serves as the entry point and is the only scene used to run the Discover Application.
-
Examples: The Examples folder contains scenes demonstrating specific features of the application. These scenes simplify understanding of certain concepts.
- Colocation: Demonstrates colocation between players in the same room, showing scene elements in the same location.
- RoomMapping: Shows how the Scene API loads rooms and generates elements once a room is mapped by the user.
- SimpleMRScene: Demonstrates the setup required to use passthrough and start an MR application.
- StartupExample: A simple launcher for the application that handles entitlement checks and user data.
This section provides more information on some subgroups of scripts in Assets/Discover/Scripts.
- Colocation: Implements interfaces for the colocation package and its usage for colocating users.
- ColocationDriverNetObj: A key component that sets up colocation logic as a network behavior.
- ColocationTestBootStrapper: Used in the Colocation example scene to test the colocation flow.
- Networking: Contains functionalities related to Photon Fusion Networking.
- NUX: Manages new user experience views with multiple pages. The NUXManager handles launching, stopping, and resetting NUXControllers.
- SpatialAnchors: Provides functionalities to save, load, and erase local anchors to a file. This system is reusable for saving anchors to a file or any desired location, including custom cloud solutions.
- Fake Room: Allows faster loading in the editor without using Link and the XRSimulator. It includes a custom implementation for classifications, creating equivalence from the OVRSemanticClassification.
- MRSceneLoader: Handles loading the correct scene. If no headsets are connected, it loads the FakeRoom prefab.
Located at Assets/Discover/DroneRage, this application organizes content by game elements rather than asset type. All scripts are in the Scripts folder.
Located at Assets/MRBike, this standalone application is integrated into Discover. The root is the BikeInteraction prefab, which can be instantiated by the photon runner to launch the bike application. BikeVisibleObjects are networked to maintain their state as parts are placed or moved.