/// <summary> /// Draws device selection menu. /// </summary> void OnGUI() { if (GUIVisible) { GUI.skin = ALPSSkin; // Make a background box GUI.Box(new Rect(0, 0, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix), "Choose a device"); if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.15f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Default")) { controller.SetDevice(Device.DEFAULT); } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.30f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Altergaze")) { controller.SetDevice(Device.ALTERGAZE); } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.45f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Cardboard")) { controller.SetDevice(Device.CARDBOARD); } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.60f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Firefly VR")) { controller.SetDevice(Device.FIREFLY); } } }
/// <summary> /// Draws device selection menu. /// </summary> void OnGUI() { if (GUIVisible) { if (GUIMenu) { GUI.skin = ALPSSkin; GUI.Box(new Rect(0, 0, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix), "Menu"); if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.15f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Choose a device")) { GUIDeviceSelection = true; GUIMenu = false; } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.30f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Custom configuration")) { GUICustomConfiguration = true; GUIMenu = false; } } if (GUIDeviceSelection) { GUI.skin = ALPSSkin; // Make a background box GUI.Box(new Rect(0, 0, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix), "Choose a device"); if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.15f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Back")) { GUIMenu = true; GUIDeviceSelection = false; } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.30f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Default")) { controller.SetDevice(Device.DEFAULT); } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.45f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Altergaze")) { controller.SetDevice(Device.ALTERGAZE); } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.60f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Cardboard")) { controller.SetDevice(Device.CARDBOARD); } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.75f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Firefly VR")) { controller.SetDevice(Device.FREEFLY_VR); } } if (GUICustomConfiguration) { GUI.skin = ALPSSkin; GUI.Box(new Rect(0, 0, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix), "Custom configuration"); //Back if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.15f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.15f), "Back")) { GUIMenu = true; GUICustomConfiguration = false; } //Barrel distortion //K1 if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.30f, ALPSController.screenWidthPix * 0.175f, ALPSController.screenHeightPix * 0.10f), "Barrel distortion K1 : " + controller.deviceConfig.k1.ToString("F1"))) { } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.40f, ALPSController.screenWidthPix * 0.175f, ALPSController.screenHeightPix * 0.10f), "Less")) { controller.AddToK1(-0.1f); } if (GUI.Button(new Rect(ALPSController.screenWidthPix * 0.125f, ALPSController.screenHeightPix * 0.40f, ALPSController.screenWidthPix * 0.125f, ALPSController.screenHeightPix * 0.10f), "More")) { controller.AddToK1(0.1f); } //K2 if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.50f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.10f), "Barrel distortion K2 : " + controller.deviceConfig.k2.ToString("F1"))) { } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.60f, ALPSController.screenWidthPix * 0.125f, ALPSController.screenHeightPix * 0.10f), "Less")) { controller.AddToK2(-0.1f); } if (GUI.Button(new Rect(ALPSController.screenWidthPix * 0.125f, ALPSController.screenHeightPix * 0.60f, ALPSController.screenWidthPix * 0.125f, ALPSController.screenHeightPix * 0.10f), "More")) { controller.AddToK2(0.1f); } //CC if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.70f, ALPSController.screenWidthPix * 0.25f, ALPSController.screenHeightPix * 0.10f), "Chromatic correction : " + controller.deviceConfig.chromaticCorrection.ToString("F1"))) { } if (GUI.Button(new Rect(0, ALPSController.screenHeightPix * 0.80f, ALPSController.screenWidthPix * 0.125f, ALPSController.screenHeightPix * 0.10f), "Less")) { controller.AddToChromaticCorrection(-0.1f); } if (GUI.Button(new Rect(ALPSController.screenWidthPix * 0.125f, ALPSController.screenHeightPix * 0.80f, ALPSController.screenWidthPix * 0.125f, ALPSController.screenHeightPix * 0.10f), "More")) { controller.AddToChromaticCorrection(0.1f); } } } }