private void HandleEditorWindowButton() { TierSettingsWindow window = TierSettingsWindow.GetInstance(); GUIContent text = window == null ? Styles.showEditorWindow : Styles.closeEditorWindow; if (GUILayout.Button(text, EditorStyles.miniButton, GUILayout.Width(110))) { if (window) { window.Close(); } else { TierSettingsWindow.CreateWindow(); TierSettingsWindow.GetInstance().Show(); } } }
private void HandleEditorWindowButton() { TierSettingsWindow instance = TierSettingsWindow.GetInstance(); GUIContent content = (!(instance == null)) ? GraphicsSettingsInspector.Styles.closeEditorWindow : GraphicsSettingsInspector.Styles.showEditorWindow; if (GUILayout.Button(content, EditorStyles.miniButton, new GUILayoutOption[] { GUILayout.Width(110f) })) { if (instance) { instance.Close(); } else { TierSettingsWindow.CreateWindow(); TierSettingsWindow.GetInstance().Show(); } } }
public override void OnInspectorGUI() { serializedObject.Update(); GUILayout.Label(Styles.renderPipeSettings, EditorStyles.boldLabel); EditorGUI.RenderPipelineAssetField(serializedObject, m_ScriptableRenderLoop); EditorGUILayout.Space(); bool usingSRP = GraphicsSettings.currentRenderPipeline != null; if (usingSRP) { EditorGUILayout.HelpBox("A Scriptable Render Pipeline is in use, some settings will not be used and are hidden", MessageType.Info); } if (!usingSRP) { GUILayout.Label(Styles.cameraSettings, EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_TransparencySortMode); EditorGUILayout.PropertyField(m_TransparencySortAxis); EditorGUILayout.Space(); } float labelWidth = EditorGUIUtility.labelWidth; // Hide tier settings for SRPs and close tier settings window if open if (usingSRP) { TierSettingsWindow window = TierSettingsWindow.GetInstance(); if (window != null) { window.Close(); } } else { TierSettingsGUI(); } EditorGUIUtility.labelWidth = labelWidth; GUILayout.Label(Styles.builtinSettings, EditorStyles.boldLabel); if (!usingSRP) { builtinShadersEditor.OnInspectorGUI(); } videoShadersEditor.OnInspectorGUI(); alwaysIncludedShadersEditor.OnInspectorGUI(); EditorGUILayout.Space(); GUILayout.Label(Styles.shaderStrippingSettings, EditorStyles.boldLabel); shaderStrippingEditor.OnInspectorGUI(); EditorGUILayout.Space(); GUILayout.Label(Styles.shaderPreloadSettings, EditorStyles.boldLabel); EditorGUILayout.PropertyField(m_LogWhenShaderIsCompiled, Styles.logWhenShaderIsCompiled); EditorGUILayout.IntPopup(m_LightProbeOutsideHullStrategy, Styles.lightProbeOutsideHullStrategyStrings, Styles.lightProbeOutsideHullStrategyValues, Styles.lightProbeOutsideHullStrategy); shaderPreloadEditor.OnInspectorGUI(); serializedObject.ApplyModifiedProperties(); }