PauseController.cs - POINT-VR/POINT-VR-Chapter-1 GitHub Wiki

Page Creation in Progress

This guide is aimed towards developers and contains the following sections:

  1. Summary of PauseController.cs
  2. Where To Find PauseController.cs
  3. Code Overview
  4. Editing of PauseController.cs

Summary of PauseController.cs

The PauseController.cs script manages the pausing and resuming of the simulation, as well as the displaying of the pause menu. The script listens for a specific input action to toggle the pause state, and does the following things when the simulation is paused:

  • Stops in-simulation time and pauses audio and subtitle progression
  • Shows the pause menu and repositions the UI relative to the camera
  • Temporarily disables gameObjects not part of the Player
  • Adjusts hand interactions and laser visuals to prevent interference with the menu

The script also provides the methods Pause() and unPause() for other scripts to control the pause state.

Where To Find PauseController.cs

Access Through Local File System

  1. Find and open the folder where you cloned the Point-VR-Chapter-1 Github Repository
  2. Open the Point-VR-Chapter-1 Directory
  3. Open the Assets Directory
  4. Open the POINT Directory
  5. Open the InputAssets Directory
  6. The PauseController.cs script should be in this folder and you should be able to open this in your code editor

Access Through Unity Editor File System

  1. Open the POINT VR project in the Unity editor
  2. Locate the Project window (usually located at the bottom of the Unity Editor)
  3. Expand the Assets Folder in the file hierarchy
  4. Expand the POINT Folder under Assets
  5. Click on the InputAssets folder under POINT
  6. You should see the PauseController.cs script in this folder and you should be able to open this in your code editor

Location in the Scene

The PauseController.cs script is attached to the Player object in the Unity scenes, and can thus be found in the scene through the following steps:

  1. Open the POINT VR project in the Unity editor
  2. Ensure that you are in any scene, and enter Play Mode (if you do not enter play mode you will not be able to find the file)
  3. Locate the Hierarchy window (this is where all the gameObjects in the scene are listed)
  4. Expand the PlayerBase gameObject
  5. Click on the Player(Clone) gameObject that is a child of PlayerBase
  6. In the Inspector, look for Pause Controller (Script)
  7. You can double click the PauseController.cs script in the Inspector to open it. The variables listed below it in the Inspector come from the public or serialized fields in the script. Each field holds data or references used by PauseController.cs. These fields will be described below.

Code Overview

Editing of PauseController.cs

⚠️ **GitHub.com Fallback** ⚠️