Exemple #1
0
        private void TierSettingsGUI()
        {
            if (this.tierSettingsAnimator == null)
            {
                this.tierSettingsAnimator = new AnimBool(this.showTierSettingsUI, new UnityAction(base.Repaint));
            }
            bool enabled = GUI.enabled;

            GUI.enabled = true;
            EditorGUILayout.BeginVertical(GUI.skin.box, new GUILayoutOption[0]);
            EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
            Rect rect = GUILayoutUtility.GetRect(20f, 18f);

            rect.x     += 3f;
            rect.width += 6f;
            this.showTierSettingsUI = GUI.Toggle(rect, this.showTierSettingsUI, GraphicsSettingsInspector.Styles.tierSettings, EditorStyles.inspectorTitlebarText);
            this.HandleEditorWindowButton();
            EditorGUILayout.EndHorizontal();
            this.tierSettingsAnimator.target = this.showTierSettingsUI;
            GUI.enabled = enabled;
            if (EditorGUILayout.BeginFadeGroup(this.tierSettingsAnimator.faded) && TierSettingsWindow.GetInstance() == null)
            {
                this.tierSettingsEditor.OnInspectorGUI();
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUILayout.EndVertical();
        }
        private void TierSettingsGUI()
        {
            if (tierSettingsAnimator == null)
            {
                tierSettingsAnimator = new UnityEditor.AnimatedValues.AnimBool(showTierSettingsUI, Repaint);
            }

            bool enabled = GUI.enabled;

            GUI.enabled = true; // we don't want to disable the expand behavior
            EditorGUILayout.BeginVertical(GUI.skin.box);

            EditorGUILayout.BeginHorizontal();
            Rect r = GUILayoutUtility.GetRect(20, 18); r.x += 3; r.width += 6;

            showTierSettingsUI = GUI.Toggle(r, showTierSettingsUI, Styles.tierSettings, EditorStyles.inspectorTitlebarText);
            HandleEditorWindowButton();
            EditorGUILayout.EndHorizontal();

            tierSettingsAnimator.target = showTierSettingsUI;
            GUI.enabled = enabled;

            if (EditorGUILayout.BeginFadeGroup(tierSettingsAnimator.faded) && TierSettingsWindow.GetInstance() == null)
            {
                tierSettingsEditor.OnInspectorGUI();
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUILayout.EndVertical();
        }
 void OnDisable()
 {
     DestroyImmediate(m_TierSettingsEditor); m_TierSettingsEditor = null;
     if (s_Instance == this)
     {
         s_Instance = null;
     }
 }
Exemple #4
0
 private void OnDisable()
 {
     UnityEngine.Object.DestroyImmediate(this.m_TierSettingsEditor);
     this.m_TierSettingsEditor = null;
     if (TierSettingsWindow.s_Instance == this)
     {
         TierSettingsWindow.s_Instance = null;
     }
 }
        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();
                }
            }
        }
Exemple #6
0
        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();
                }
            }
        }
        private void TierSettingsGUI()
        {
            bool enabled = GUI.enabled;

            GUI.enabled = true; // we don't want to disable the expand behavior
            EditorGUILayout.BeginVertical(EditorStyles.helpBox, GUILayout.Height(20));

            EditorGUILayout.BeginHorizontal();
            Rect r = GUILayoutUtility.GetRect(20, 21); r.x += 3; r.width += 6;

            showTierSettingsUI = EditorGUI.FoldoutTitlebar(r, Styles.tierSettings, showTierSettingsUI, true, EditorStyles.inspectorTitlebarFlat, EditorStyles.inspectorTitlebarText);
            HandleEditorWindowButton();
            EditorGUILayout.EndHorizontal();

            tierSettingsAnimator.target = showTierSettingsUI;
            GUI.enabled = enabled;

            if (EditorGUILayout.BeginFadeGroup(tierSettingsAnimator.faded) && TierSettingsWindow.GetInstance() == null)
            {
                tierSettingsEditor.OnInspectorGUI();
            }
            EditorGUILayout.EndFadeGroup();
            EditorGUILayout.EndVertical();
        }
        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();
        }
Exemple #9
0
 private void OnEnable()
 {
     TierSettingsWindow.s_Instance = this;
 }
Exemple #10
0
 public static void CreateWindow()
 {
     TierSettingsWindow.s_Instance              = EditorWindow.GetWindow <TierSettingsWindow>();
     TierSettingsWindow.s_Instance.minSize      = new Vector2(600f, 300f);
     TierSettingsWindow.s_Instance.titleContent = EditorGUIUtility.TrTextContent("Tier Settings", null, null);
 }
 void OnEnable()
 {
     s_Instance = this;
 }
 static public void CreateWindow()
 {
     s_Instance              = EditorWindow.GetWindow <TierSettingsWindow>();
     s_Instance.minSize      = new Vector2(600, 300);
     s_Instance.titleContent = EditorGUIUtility.TrTextContent("Tier Settings");
 }