Advertisement
Guest User

BuildVRSettings

a guest
Mar 29th, 2016
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement