daily pastebin goal
48%
SHARE
TWEET

BuildVRSettings

a guest Mar 29th, 2016 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using UnityEditor;
  3.  
  4. public class BuildVRSettings {
  5.     [MenuItem("VR Build Settings/Build GearVR")]
  6.     static void BuildGearVRSettings() {
  7.         PlayerSettings.virtualRealitySupported = true;
  8.         GameObject.Find("VRMain").transform.GetChild(0).gameObject.SetActive(true);
  9.         GameObject.Find("VRMain").transform.GetChild(1).gameObject.SetActive(false);
  10.     }
  11.  
  12.     [MenuItem("VR Build Settings/Build Cardboard")]
  13.     static void BuildCardboardSettings() {
  14.         PlayerSettings.virtualRealitySupported = false;
  15.         GameObject.Find("VRMain").transform.GetChild(0).gameObject.SetActive(false);
  16.         GameObject.Find("VRMain").transform.GetChild(1).gameObject.SetActive(true);
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top