-
-
Save Mesidin/057e14277f8d9fa64664 to your computer and use it in GitHub Desktop.
Revisions
-
radiatoryang created this gist
Mar 4, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ using UnityEngine; using System.Collections; using UnityEngine.VR; // you always need this to use special VR functions public class VRUtility : MonoBehaviour { // Use this for initialization public void Start () { // set render quality to 50%, sacrificing visual quality for higher FPS // this is pretty important on laptops, where the framerate is often quite low // 50% quality actually isn't that bad VRSettings.renderScale = 0.50f; } // Update is called once per frame void Update () { if ( Input.GetKeyDown(KeyCode.R) ) { InputTracking.Recenter(); // recenter "North" for VR, so that you don't have to twist around randomlys } // dynamically adjust VR visual quality in-game if ( Input.GetKeyDown(KeyCode.RightBracket) ) { // increase visual quality VRSettings.renderScale = Mathf.Clamp01( VRSettings.renderScale + 0.1f); } if ( Input.GetKeyDown(KeyCode.LeftBracket) ) { // decrease visual quality VRSettings.renderScale = Mathf.Clamp01( VRSettings.renderScale - 0.1f); } } }