public override void OnPreferenceGUI() { const string title = "Oculus Rift & Touch"; if (canSupport) { support = Foldouter.ShowFoldoutBlankWithEnabledToggle(new GUIContent(title), support); } else { GUILayout.BeginHorizontal(); Foldouter.ShowFoldoutBlank(); if (activeBuildTargetGroup != BuildTargetGroup.Standalone) { GUI.enabled = false; ShowToggle(new GUIContent(title, "Standalone platform required."), false, GUILayout.Width(150f)); GUI.enabled = true; GUILayout.FlexibleSpace(); ShowSwitchPlatformButton(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64); } else if (!VRModule.isOculusVRPluginDetected) { GUI.enabled = false; ShowToggle(new GUIContent(title, "Oculus VR Plugin required."), false, GUILayout.Width(150f)); GUI.enabled = true; GUILayout.FlexibleSpace(); ShowUrlLinkButton(URL_OCULUS_VR_PLUGIN); } GUILayout.EndHorizontal(); } }
public override void OnPreferenceGUI() { const string title = "Oculus Desktop"; if (canSupport) { support = Foldouter.ShowFoldoutBlankWithEnabledToggle(new GUIContent(title, "Oculus Rift, Oculus Rift S"), support); } else { GUILayout.BeginHorizontal(); Foldouter.ShowFoldoutBlank(); if (activeBuildTargetGroup != BuildTargetGroup.Standalone) { GUI.enabled = false; ShowToggle(new GUIContent(title, "Standalone platform required."), false, GUILayout.Width(150f)); GUI.enabled = true; GUILayout.FlexibleSpace(); ShowSwitchPlatformButton(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64); } #if UNITY_2019_3_OR_NEWER else if (!PackageManagerHelper.IsPackageInList(OCULUS_XR_PACKAGE_NAME)) { GUI.enabled = false; ShowToggle(new GUIContent(title, "Oculus XR Plugin package required."), false, GUILayout.Width(230f)); GUI.enabled = true; GUILayout.FlexibleSpace(); ShowAddPackageButton("Oculus XR Plugin", OCULUS_XR_PACKAGE_NAME); } #endif #if !UNITY_2020_1_OR_NEWER else if (!PackageManagerHelper.IsPackageInList(OCULUS_DESKTOP_PACKAGE_NAME)) { GUI.enabled = false; ShowToggle(new GUIContent(title, "Oculus (Desktop) package required."), false, GUILayout.Width(230f)); GUI.enabled = true; GUILayout.FlexibleSpace(); ShowAddPackageButton("Oculus (Desktop)", OCULUS_DESKTOP_PACKAGE_NAME); } #endif else if (!VRModule.isOculusVRPluginDetected) { GUI.enabled = false; ShowToggle(new GUIContent(title, "Oculus VR Plugin required."), false, GUILayout.Width(150f)); GUI.enabled = true; GUILayout.FlexibleSpace(); ShowUrlLinkButton(URL_OCULUS_VR_PLUGIN); } GUILayout.EndHorizontal(); } }