Skip to content

About

Unity campus-tour navigation scripts with checked waypoint routing. Script supplement; scenes and headset build not included.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

eCampusExplorer

C# scripts from an NYU Abu Dhabi VR campus-tour coursework prototype. The tour moves between 360° scenes using a graph of 156 campus waypoints.

This is a script supplement, not an importable Unity project. Scenes, photographs, prefabs, .meta files, package manifests, and headset builds are not included. You need your own scene assets and Unity project to run it.

What is here

Script Responsibility
CampusRoutes.cs 156 waypoints and 345 enabled directional connections; pure C# lookup
Teleporter.cs Responds to navigation-arrow collisions and requests a scene change
CampusSceneLoader.cs Checks that a scene is available before loading it
PlayerPrefSetter.cs Stores the current scene's waypoint ID; rejects invalid IDs
ButtonFunctions.cs Start tour, toggle About text, and quit
MainMenuSceneSwitcher.cs Return to the Main Menu scene
PlayerController.cs Thumbstick translation and rotation through OVRInput; provided controller credited below

Unknown states, disabled directions, missing scenes, and unrelated collisions do not navigate. A successful transition ignores subsequent triggers on the same component.

Wiring the scripts into Unity

The controller depends on the Oculus/Meta package that supplies OVRInput. These scripts do not use XR Interaction Toolkit. The original Unity/package versions are not recorded, so no specific editor or headset configuration is certified here.

  1. Put the root C# files into your project's Assets/Scripts folder. Keep the tests directory outside Assets; it contains standalone test doubles.
  2. Add each destination scene to Build Settings using the exact names in CampusRoutes.cs. Add Main Menu and the initial scene 1_WC_to_Palms.
  3. Add PlayerPrefSetter to each waypoint scene and set globalStateValue to its ID, such as 1, 101, or 203.1. docs/scenes.csv maps every destination scene to its ID, including the two 204_ scenes with different IDs. The empty default intentionally reports a configuration error.
  4. Attach Teleporter to the object that enters the navigation triggers. Configure Unity colliders/rigidbodies to receive OnTriggerEnter. Arrow objects need the NavigationArrow tag and one of these exact names: ForwardButton, BackwardButton, LeftButton, RightButton.
  5. Wire menu buttons to ButtonFunctions and MainMenuSceneSwitcher; assign the About text object in the Inspector.
  6. If using the supplied controller, attach PlayerController to the rig. Its right stick translates in world axes; its left stick rotates. It has no collision-aware locomotion or raycast selection.

Checks

With .NET 8:

dotnet run --project tests/NavigationTests.csproj --configuration Release

CI compiles all root scripts against minimal Unity/OVR test doubles and checks graph integrity, invalid states, disabled routes, missing scenes, and duplicate triggers. This verifies navigation logic only. Unity Play Mode, scene wiring, rendering, controller input, and headset comfort still need testing in a complete project.

Credits and license

Ashmit Mukherjee's coursework repository. PlayerController.cs retains its original Pi Ko, 24 September 2023 author header; it is not claimed as Ashmit's original implementation. See ATTRIBUTION.md for the limits of the included license.

About

Unity campus-tour navigation scripts with checked waypoint routing. Script supplement; scenes and headset build not included.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages