PPaste!

Miam Unity

Home - All the pastes - Authored by Thooms

Raw version

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
    [MenuItem("VR Build Settings/Switch to Gear VR Build")]
    static void BuildGearVRSettings() {
        PlayerSettings.virtualRealitySupported = true;
        GvrViewer Viewer = GameObject.Find("GvrViewerMain").GetComponent<GvrViewer>();
        GvrHead Head = GameObject.Find("Main Camera").GetComponent<GvrHead>();
        Viewer.VRModeEnabled = false;
        Head.trackPosition = false;
        Head.trackRotation = false;

        EditorWindow window = new BuildPopup("Switch to GearVR Build", "Le changement a bien été effectué");
        window.ShowUtility();
    }

    [MenuItem("VR Build Settings/Switch to Google VR Build")]
    static void BuildGoogleVRSettings() {
        PlayerSettings.virtualRealitySupported = false;
        GvrViewer Viewer = GameObject.Find("GvrViewerMain").GetComponent<GvrViewer>();
        GvrHead Head = GameObject.Find("Main Camera").GetComponent<GvrHead>();
        Viewer.VRModeEnabled = true;
        Head.trackPosition = true;
        Head.trackRotation = true;

        EditorWindow window = new BuildPopup("Switch to Google Build", "Le changement a bien été effectué");
        window.ShowUtility();
    }