void OnGUI() { GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Advanced Settings"); if (GUILayout.Button("X")) { if (m_resultCallback != null) { m_resultCallback(Result.Cancel); } CloseDialog(); } EditorGUILayout.EndHorizontal(); DaydreamRenderer renderer = FindObjectOfType <DaydreamRenderer>(); if (renderer == null) { EditorGUILayout.LabelField("Daydream Renderer Not Enabled"); return; } // ------------------------------------------------------------------- // // Daydream Lighting Advanced settings GUILayout.Space(5); DaydreamRendererImportManager.DrawSection(240, 1); renderer.m_enableManualLightingComponents = EditorGUILayout.BeginToggleGroup(Styles.toggleComponents, renderer.m_enableManualLightingComponents); { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(Styles.addComponents)) { DaydreamRendererImportManager.ApplyLightingComponents(); } if (GUILayout.Button(Styles.removeComponents)) { DaydreamRendererImportManager.RemoveAllLightingComponents(); } EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndToggleGroup(); // Add components to FBX and Prefabs not in the scene // TODO - rework this UI /* * EditorGUILayout.BeginHorizontal(); * if (GUILayout.Button(Styles.addComponentsToProject)) * { * DaydreamRendererImportManager.ApplyLightingToProject(); * } * if (GUILayout.Button(Styles.removeComponentsFromProject)) * { * DaydreamRendererImportManager.RemoveAllLightingComponents(); * } * EditorGUILayout.EndHorizontal(); * //*/ }
public static void DrawDaydreamLightingToggle(DaydreamRenderer renderer) { if (renderer == null) { return; } // determine lighting system in use const int kDaydreamLighting = 0; const int kUnityLighting = 1; int selectedIndex = renderer.m_daydreamLighting ? kDaydreamLighting : kUnityLighting; EditorGUI.BeginChangeCheck(); // draw section separator DrawSection(500, 1); EditorGUILayout.BeginHorizontal(); if (selectedIndex == kDaydreamLighting) { EditorGUILayout.LabelField("Lighting System", Styles.sectionLabel, GUILayout.Width(105), GUILayout.Height(25)); GUILayout.Button("", Styles.daydreamLightingStyle, GUILayout.Width(25), GUILayout.Height(25)); } else { EditorGUILayout.LabelField("Lighting System", Styles.sectionLabel, GUILayout.Width(105), GUILayout.Height(25)); GUILayout.Button("", Styles.unityLightingStyle, GUILayout.Width(25), GUILayout.Height(25)); } EditorGUILayout.EndHorizontal(); GUILayout.Space(5); EditorGUI.BeginChangeCheck(); DREditorUtility.RadioButtonOutput selected = DREditorUtility.DrawRadioButton(selectedIndex, Styles.m_lightingSystemUI, Styles.m_buttonUnselected, Styles.m_buttonSelected, 20, 32, 150, new bool[] { true, false }); if (EditorGUI.EndChangeCheck()) { if (selected.m_selectedIndex == kDaydreamLighting) { if (renderer.m_daydreamLighting == false) { renderer.m_daydreamLighting = true; if (!renderer.m_enableManualLightingComponents) { DaydreamRendererImportManager.ApplyLightingComponents(); } renderer.EnableEnlighten(false); } } else { if (renderer.m_daydreamLighting == true) { renderer.m_daydreamLighting = false; if (!renderer.m_enableManualLightingComponents) { DaydreamRendererImportManager.RemoveAllLightingComponents(); } renderer.EnableEnlighten(true); } } // display advanced settings if (selected.m_dropDownSelected == kDaydreamLighting) { LightSystemDialog.ShowDialog(null); } } GUILayout.Space(5); }