// Populate the window based on the current settings. static void ReadCurrentSettings() { // FAKE_DAYDREAM must be checked first, since it can include RIFT or STEAM_VR too. if (oldBuildDefString.Contains("FAKE_DAYDREAM")) { platform = VRPlatforms.Daydream; if (oldBuildDefString.Contains("RIFT")) { daydreamControlSettings = DaydreamControlSettings.Rift; } else if (oldBuildDefString.Contains("STEAM_VR")) { daydreamControlSettings = DaydreamControlSettings.SteamVR; } } else if (oldBuildDefString.Contains("DAYDREAM")) { platform = VRPlatforms.Daydream; } else if (oldBuildDefString.Contains("RIFT")) { platform = VRPlatforms.Rift; } else if (oldBuildDefString.Contains("STEAM_VR")) { platform = VRPlatforms.SteamVR; } else if (oldBuildDefString.Contains("GEAR_VR")) { platform = VRPlatforms.GearVR; } else if (oldBuildDefString.Contains("MORPHEUS")) { platform = VRPlatforms.PS4; } else if (oldBuildDefString.Contains("CARDBOARD")) { platform = VRPlatforms.Cardboard; } // Other settings release = oldBuildDefString.Contains("RELEASE"); debug = oldBuildDefString.Contains("DEBUGMODE"); demo = oldBuildDefString.Contains("DEMOMODE"); // Import custom definitions if (oldBuildDefString.Contains("CUSTOMDEFS_;")) { customDefs = oldBuildDefString.Substring(customDefs.IndexOf("CUSTOMDEFS_;") + 12, oldBuildDefString.Length - 1); } }
void ShowGeneralMenu() { EditorGUIUtility.labelWidth = 170; GUILayout.BeginVertical(EditorStyles.helpBox); // General Controller Settings EditorGUILayout.LabelField("Platform Settings", sectionHeader); EditorGUILayout.Separator(); GUILayout.BeginVertical(EditorStyles.helpBox); platform = (VRPlatforms)EditorGUILayout.EnumPopup(new GUIContent("Target Platform", "The platform you're developing for."), platform); switch (platform) { case VRPlatforms.Daydream: daydreamControlSettings = (DaydreamControlSettings)EditorGUILayout.EnumPopup(new GUIContent("Daydream Emulation", "If you want to test Daydream on Oculus Touch or Steam VR / Vive, choose those settings here. Otherwise choose Native."), daydreamControlSettings); break; } switch (platform) { case VRPlatforms.Daydream: case VRPlatforms.GearVR: case VRPlatforms.Cardboard: swapManifest = (bool)EditorGUILayout.Toggle(new GUIContent("Swap Manifest", "Swap to a manfiest you've specified for this platform. See PATH SETTINGS in TBEditorBuildPanel.cs."), swapManifest); break; } GUILayout.EndVertical(); CheckForSDK(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Build Flavors", sectionHeader); EditorGUILayout.Separator(); GUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.LabelField("Optional tags for specifying features in builds."); EditorGUILayout.LabelField("If you don't know what these are, you can probably leave them blank."); EditorGUILayout.Space(); debug = (bool)EditorGUILayout.Toggle("Debug Build", debug); demo = (bool)EditorGUILayout.Toggle("Demo Build", demo); release = (bool)EditorGUILayout.Toggle("Release Build", release); GUILayout.EndVertical(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Custom Definitions", sectionHeader); EditorGUILayout.Separator(); GUILayout.BeginVertical(EditorStyles.helpBox); customDefs = (string)EditorGUILayout.TextField("Scripting Defines", customDefs); GUILayout.EndVertical(); GUILayout.EndVertical(); if (Event.current.type == EventType.Repaint) { RefreshBuildString(); } }