コード例 #1
0
        public override void OnInspectorGUI()
        {
            if (m_target == null && target == null)
            {
                base.OnInspectorGUI();
                return;
            }

            float defaultLabelWidth = EditorGUIUtility.labelWidth;
            float defaultFieldWidth = EditorGUIUtility.fieldWidth;

            //===== CONTENT REGION ========================================================================

            GUILayout.Space(20);

            #region Section -> Logo

            if (GraphyEditorStyle.LogoTexture != null)
            {
                GUILayout.Label
                (
                    image: GraphyEditorStyle.LogoTexture,
                    style: new GUIStyle(GUI.skin.GetStyle("Label"))
                {
                    alignment = TextAnchor.UpperCenter
                }
                );

                GUILayout.Space(10);
            }
            else
            {
                EditorGUILayout.LabelField
                (
                    label: "[ GRAPHY - MANAGER ]",
                    style: GraphyEditorStyle.HeaderStyle1
                );
            }

            #endregion

            GUILayout.Space(5); //Extra pixels added when the logo is used.

            #region Section -> Settings

            EditorGUIUtility.labelWidth = 130;
            EditorGUIUtility.fieldWidth = 35;

            EditorGUILayout.PropertyField
            (
                m_graphyMode,
                new GUIContent
                (
                    text: "Graphy Mode",
                    tooltip: "LIGHT mode increases compatibility with mobile and older, less powerful GPUs, but reduces the maximum graph resolutions to 128."
                )
            );

            GUILayout.Space(10);

            m_enableOnStartup.boolValue = EditorGUILayout.Toggle
                                          (
                new GUIContent
                (
                    text: "Enable On Startup",
                    tooltip: "If ticked, Graphy will be displayed by default on startup, otherwise it will initiate and hide."
                ),
                value: m_enableOnStartup.boolValue
                                          );

            // This is a neat trick to hide Graphy in the Scene if it's going to be deactivated in play mode so that it doesn't use screen space.
            if (!Application.isPlaying)
            {
                m_target.GetComponent <Canvas>().enabled = m_enableOnStartup.boolValue;
            }

            m_keepAlive.boolValue = EditorGUILayout.Toggle
                                    (
                new GUIContent
                (
                    text: "Keep Alive",
                    tooltip: "If ticked, it will survive scene changes.\n\nCAREFUL, if you set Graphy as a child of another GameObject, the root GameObject will also survive scene changes. If you want to avoid that put Graphy in the root of the Scene as its own entity."
                ),
                value: m_keepAlive.boolValue
                                    );

            GUILayout.Space(10);

            EditorGUILayout.BeginHorizontal();

            m_background.boolValue = EditorGUILayout.Toggle
                                     (
                new GUIContent
                (
                    text: "Background",
                    tooltip: "If ticked, it will show a background overlay to improve readability in cluttered scenes."
                ),
                value: m_background.boolValue
                                     );

            m_backgroundColor.colorValue = EditorGUILayout.ColorField(m_backgroundColor.colorValue);

            EditorGUILayout.EndHorizontal();

            GUILayout.Space(10);

            m_enableHotkeys.boolValue = EditorGUILayout.Toggle
                                        (
                new GUIContent
                (
                    text: "Enable Hotkeys",
                    tooltip: "If ticked, it will enable the hotkeys to be able to modify Graphy in runtime with custom keyboard shortcuts."
                ),
                value: m_enableHotkeys.boolValue
                                        );

            if (m_enableHotkeys.boolValue)
            {
                EditorGUILayout.BeginHorizontal();

                EditorGUIUtility.labelWidth = 130;
                EditorGUIUtility.fieldWidth = 35;

                EditorGUILayout.PropertyField
                (
                    m_toggleModeKeyCode,
                    new GUIContent
                    (
                        text: "Toggle Mode Key",
                        tooltip: "If ticked, it will require clicking this key and the other ones you have set up."
                    )
                );

                EditorGUIUtility.labelWidth = 30;
                EditorGUIUtility.fieldWidth = 35;

                m_toggleModeCtrl.boolValue = EditorGUILayout.Toggle
                                             (
                    new GUIContent
                    (
                        text: "Ctrl",
                        tooltip: "If ticked, it will require clicking Ctrl and the other keys you have set up."
                    ),
                    value: m_toggleModeCtrl.boolValue
                                             );

                m_toggleModeAlt.boolValue = EditorGUILayout.Toggle
                                            (
                    new GUIContent
                    (
                        text: "Alt",
                        tooltip: "If ticked, it will require clicking Alt and the other keys you have set up."
                    ),
                    value: m_toggleModeAlt.boolValue
                                            );

                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();

                EditorGUIUtility.labelWidth = 130;
                EditorGUIUtility.fieldWidth = 35;

                EditorGUILayout.PropertyField
                (
                    m_toggleActiveKeyCode,
                    new GUIContent
                    (
                        text: "Toggle Active Key",
                        tooltip: "If ticked, it will require clicking this key and the other ones you have set up."
                    )
                );

                EditorGUIUtility.labelWidth = 30;
                EditorGUIUtility.fieldWidth = 35;

                m_toggleActiveCtrl.boolValue = EditorGUILayout.Toggle
                                               (
                    new GUIContent
                    (
                        text: "Ctrl",
                        tooltip: "If ticked, it will require clicking Ctrl and the other kesy you have set up."
                    ),
                    value: m_toggleActiveCtrl.boolValue
                                               );

                m_toggleActiveAlt.boolValue = EditorGUILayout.Toggle
                                              (
                    new GUIContent
                    (
                        text: "Alt",
                        tooltip: "If ticked, it will require clicking Alt and the other keys you have set up."
                    ),
                    value: m_toggleActiveAlt.boolValue
                                              );

                EditorGUILayout.EndHorizontal();
            }

            GUILayout.Space(15);

            EditorGUIUtility.labelWidth = 155;
            EditorGUIUtility.fieldWidth = 35;

            EditorGUILayout.PropertyField
            (
                m_graphModulePosition,
                new GUIContent
                (
                    text: "Graph modules position",
                    tooltip: "Defines in which corner the modules will be located."
                )
            );

            #endregion

            GUILayout.Space(20);

            #region Section -> FPS

            m_fpsModuleInspectorToggle = EditorGUILayout.Foldout
                                         (
                m_fpsModuleInspectorToggle,
                content: " [ FPS ]",
                style: GraphyEditorStyle.FoldoutStyle
                                         );

            GUILayout.Space(5);

            if (m_fpsModuleInspectorToggle)
            {
                EditorGUILayout.PropertyField
                (
                    m_fpsModuleState,
                    new GUIContent
                    (
                        text: "Module state",
                        tooltip: "FULL -> Text + Graph \nTEXT -> Just text \nOFF -> Turned off"
                    )
                );

                GUILayout.Space(5);

                EditorGUILayout.LabelField("Fps thresholds and colors:");

                EditorGUI.indentLevel++;

                EditorGUILayout.BeginHorizontal();

                m_goodFpsThreshold.intValue = EditorGUILayout.IntField
                                              (
                    new GUIContent
                    (
                        text: "- Good",
                        tooltip: "When FPS rise above this value, this color will be used."
                    ),
                    value: m_goodFpsThreshold.intValue
                                              );

                m_goodFpsColor.colorValue = EditorGUILayout.ColorField(m_goodFpsColor.colorValue);

                EditorGUILayout.EndHorizontal();

                if (m_goodFpsThreshold.intValue <= m_cautionFpsThreshold.intValue && m_goodFpsThreshold.intValue > 1)
                {
                    m_cautionFpsThreshold.intValue = m_goodFpsThreshold.intValue - 1;
                }
                else if (m_goodFpsThreshold.intValue <= 1)
                {
                    m_goodFpsThreshold.intValue = 2;
                }

                EditorGUILayout.BeginHorizontal();

                m_cautionFpsThreshold.intValue = EditorGUILayout.IntField
                                                 (
                    new GUIContent
                    (
                        text: "- Caution",
                        tooltip: "When FPS falls between this and the Good value, this color will be used."
                    ),
                    value: m_cautionFpsThreshold.intValue
                                                 );

                m_cautionFpsColor.colorValue = EditorGUILayout.ColorField(m_cautionFpsColor.colorValue);

                EditorGUILayout.EndHorizontal();

                if (m_cautionFpsThreshold.intValue >= m_goodFpsThreshold.intValue)
                {
                    m_cautionFpsThreshold.intValue = m_goodFpsThreshold.intValue - 1;
                }
                else if (m_cautionFpsThreshold.intValue <= 0)
                {
                    m_cautionFpsThreshold.intValue = 1;
                }

                EditorGUILayout.BeginHorizontal();

                EditorGUILayout.IntField
                (
                    new GUIContent
                    (
                        text: "- Critical",
                        tooltip: "When FPS falls below the Caution value, this color will be used. (You can't have negative FPS, so this value is just for reference, it can't be changed)."
                    ),
                    value: 0
                );

                m_criticalFpsColor.colorValue = EditorGUILayout.ColorField(m_criticalFpsColor.colorValue);

                EditorGUILayout.EndHorizontal();

                EditorGUI.indentLevel--;

                if (m_fpsModuleState.intValue == 0)
                {
                    m_fpsGraphResolution.intValue = EditorGUILayout.IntSlider
                                                    (
                        new GUIContent
                        (
                            text: "Graph resolution",
                            tooltip: "Defines the amount of points in the graph"
                        ),
                        m_fpsGraphResolution.intValue,
                        leftValue: 20,
                        rightValue: m_graphyMode.intValue == 0 ? 300 : 128
                                                    );
                }

                EditorGUIUtility.labelWidth = 180;
                EditorGUIUtility.fieldWidth = 35;

                m_timeToResetMinMaxFps.intValue = EditorGUILayout.IntSlider
                                                  (
                    new GUIContent
                    (
                        text: "Time to reset min/max values",
                        tooltip: "If the min/max value doesn't change in the specified time, they will be reset. This allows tracking the min/max fps in a shorter interval. \n\nSet it to 0 if you don't want it to reset."
                    ),
                    m_timeToResetMinMaxFps.intValue,
                    leftValue: 0,
                    rightValue: 120
                                                  );

                EditorGUIUtility.labelWidth = 155;
                EditorGUIUtility.fieldWidth = 35;

                m_fpsTextUpdateRate.intValue = EditorGUILayout.IntSlider
                                               (
                    new GUIContent
                    (
                        text: "Text update rate",
                        tooltip: "Defines the amount times the text is updated in 1 second."
                    ),
                    m_fpsTextUpdateRate.intValue,
                    leftValue: 1,
                    rightValue: 60
                                               );
            }

            #endregion

            GUILayout.Space(20);

            #region Section -> RAM

            m_ramModuleInspectorToggle = EditorGUILayout.Foldout
                                         (
                m_ramModuleInspectorToggle,
                content: " [ RAM ]",
                style: GraphyEditorStyle.FoldoutStyle
                                         );

            GUILayout.Space(5);

            if (m_ramModuleInspectorToggle)
            {
                EditorGUILayout.PropertyField
                (
                    m_ramModuleState,
                    new GUIContent
                    (
                        text: "Module state",
                        tooltip: "FULL -> Text + Graph \nTEXT -> Just text \nOFF -> Turned off"
                    )
                );

                GUILayout.Space(5);

                EditorGUILayout.LabelField("Graph colors:");

                EditorGUI.indentLevel++;

                m_allocatedRamColor.colorValue = EditorGUILayout.ColorField
                                                 (
                    label: "- Allocated",
                    value: m_allocatedRamColor.colorValue
                                                 );

                m_reservedRamColor.colorValue = EditorGUILayout.ColorField
                                                (
                    label: "- Reserved",
                    value: m_reservedRamColor.colorValue
                                                );

                m_monoRamColor.colorValue = EditorGUILayout.ColorField
                                            (
                    label: "- Mono",
                    value: m_monoRamColor.colorValue
                                            );

                EditorGUI.indentLevel--;

                if (m_ramModuleState.intValue == 0)
                {
                    m_ramGraphResolution.intValue = EditorGUILayout.IntSlider(
                        new GUIContent
                        (
                            text: "Graph resolution",
                            tooltip: "Defines the amount of points are in the graph"
                        ),
                        m_ramGraphResolution.intValue,
                        leftValue: 20,
                        rightValue: m_graphyMode.intValue == 0 ? 300 : 128
                        );
                }

                m_ramTextUpdateRate.intValue = EditorGUILayout.IntSlider
                                               (
                    new GUIContent
                    (
                        text: "Text update rate",
                        tooltip: "Defines the amount times the text is updated in 1 second."
                    ),
                    m_ramTextUpdateRate.intValue,
                    leftValue: 1,
                    rightValue: 60
                                               );
            }

            #endregion

            GUILayout.Space(20);

            #region Section -> Audio

            m_audioModuleInspectorToggle = EditorGUILayout.Foldout
                                           (
                m_audioModuleInspectorToggle,
                content: " [ AUDIO ]",
                style: GraphyEditorStyle.FoldoutStyle
                                           );

            GUILayout.Space(5);

            if (m_audioModuleInspectorToggle)
            {
                EditorGUILayout.PropertyField
                (
                    m_audioModuleState,
                    new GUIContent
                    (
                        text: "Module state",
                        tooltip: "FULL -> Text + Graph \nTEXT -> Just text \nOFF -> Turned off"
                    )
                );

                GUILayout.Space(5);

                EditorGUILayout.PropertyField
                (
                    m_findAudioListenerInCameraIfNull,
                    new GUIContent
                    (
                        text: "Find audio listener",
                        tooltip: "Tries to find the AudioListener in the Main camera in the scene. (if AudioListener is null)"
                    )
                );

                EditorGUILayout.PropertyField
                (
                    m_audioListener,
                    new GUIContent
                    (
                        text: "Audio Listener",
                        tooltip: "Graphy will take the data from this Listener. If none are specified, it will try to get it from the Main Camera in the scene."
                    )
                );

                if (m_audioModuleState.intValue == 0)
                {
                    m_audioGraphColor.colorValue = EditorGUILayout.ColorField
                                                   (
                        label: "Graph color",
                        value: m_audioGraphColor.colorValue
                                                   );

                    m_audioGraphResolution.intValue = EditorGUILayout.IntSlider
                                                      (
                        new GUIContent
                        (
                            text: "Graph resolution",
                            tooltip: "Defines the amount of points that are in the graph."
                        ),
                        m_audioGraphResolution.intValue,
                        leftValue: 20,
                        rightValue: m_graphyMode.intValue == 0 ? 300 : 128
                                                      );

                    // Forces the value to be a multiple of 3, this way the audio graph is painted correctly
                    if (m_audioGraphResolution.intValue % 3 != 0 && m_audioGraphResolution.intValue < 300)
                    {
                        m_audioGraphResolution.intValue += 3 - m_audioGraphResolution.intValue % 3;
                    }
                    //TODO: Figure out why a static version of the ForceMultipleOf3 isnt used.
                }

                EditorGUILayout.PropertyField
                (
                    m_FFTWindow,
                    new GUIContent
                    (
                        text: "FFT Window",
                        tooltip: "Used to reduce leakage between frequency bins/bands. Note, the more complex window type, the better the quality, but reduced speed. \n\nSimplest is rectangular. Most complex is BlackmanHarris"
                    )
                );

                m_spectrumSize.intValue = EditorGUILayout.IntSlider
                                          (
                    new GUIContent
                    (
                        text: "Spectrum size",
                        tooltip: "Has to be a power of 2 between 128-8192. The higher sample rate, the less precision but also more impact on performance. Careful with mobile devices"
                    ),
                    m_spectrumSize.intValue,
                    leftValue: 128,
                    rightValue: 8192
                                          );

                int closestSpectrumIndex       = 0;
                int minDistanceToSpectrumValue = 100000;

                for (int i = 0; i < m_spectrumSizeValues.Length; i++)
                {
                    int newDistance = Mathf.Abs
                                      (
                        value: m_spectrumSize.intValue - m_spectrumSizeValues[i]
                                      );

                    if (newDistance < minDistanceToSpectrumValue)
                    {
                        minDistanceToSpectrumValue = newDistance;
                        closestSpectrumIndex       = i;
                    }
                }

                m_spectrumSize.intValue = m_spectrumSizeValues[closestSpectrumIndex];

                m_audioTextUpdateRate.intValue = EditorGUILayout.IntSlider
                                                 (
                    new GUIContent
                    (
                        text: "Text update rate",
                        tooltip: "Defines the amount times the text is updated in 1 second"
                    ),
                    m_audioTextUpdateRate.intValue,
                    leftValue: 1,
                    rightValue: 60
                                                 );
            }

            #endregion

            GUILayout.Space(20);

            #region Section -> Advanced Settings

            m_advancedModuleInspectorToggle = EditorGUILayout.Foldout
                                              (
                m_advancedModuleInspectorToggle,
                content: " [ ADVANCED DATA ]",
                style: GraphyEditorStyle.FoldoutStyle
                                              );

            GUILayout.Space(5);

            if (m_advancedModuleInspectorToggle)
            {
                EditorGUILayout.PropertyField(m_advancedModulePosition);

                EditorGUILayout.PropertyField
                (
                    m_advancedModuleState,
                    new GUIContent
                    (
                        text: "Module state",
                        tooltip: "FULL -> Text \nOFF -> Turned off"
                    )
                );
            }

            #endregion ;

            EditorGUIUtility.labelWidth = defaultLabelWidth;
            EditorGUIUtility.fieldWidth = defaultFieldWidth;

            serializedObject.ApplyModifiedProperties();
        }
コード例 #2
0
ファイル: GraphyManagerEditor.cs プロジェクト: keekekx/FP-MOG
        public override void OnInspectorGUI()
        {
            if (m_target == null && target == null)
            {
                base.OnInspectorGUI();
                return;
            }

            LoadGuiStyles();

            float defaultLabelWidth = EditorGUIUtility.labelWidth;
            float defaultFieldWidth = EditorGUIUtility.fieldWidth;

            GUIStyle foldoutStyle = new GUIStyle(EditorStyles.foldout)
            {
                font          = m_headerStyle2.font,
                fontStyle     = m_headerStyle2.fontStyle,
                contentOffset = Vector2.down * 3f   //TODO: Maybe replace this with "new Vector2(0f, -3f);"
            };

            SetGuiStyleFontColor
            (
                guiStyle:   foldoutStyle,
                color:      EditorGUIUtility.isProSkin ? Color.white : Color.black
            );

            //===== CONTENT REGION ========================================================================

            GUILayout.Space(20);

            #region Section -> Logo

            if (m_logoTexture != null)
            {
                GUILayout.Label
                (
                    image: m_logoTexture,
                    style: new GUIStyle(GUI.skin.GetStyle("Label"))
                {
                    alignment = TextAnchor.UpperCenter
                }
                );

                GUILayout.Space(10);
            }
            else
            {
                EditorGUILayout.LabelField
                (
                    label: "[ GRAPHY - MANAGER ]",
                    style: m_headerStyle1
                );
            }

            #endregion

            GUILayout.Space(5); //Extra pixels added when the logo is used.

            #region Section -> Settings

            EditorGUIUtility.labelWidth = 130;
            EditorGUIUtility.fieldWidth = 35;

            EditorGUILayout.PropertyField
            (
                m_graphyMode,
                new GUIContent
                (
                    text:       "Graphy Mode",
                    tooltip:    "LIGHT mode increases compatibility with mobile and older, less powerful GPUs, but reduces the maximum graph resolutions to 128."
                )
            );

            GUILayout.Space(10);

            m_enableOnStartup.boolValue = EditorGUILayout.Toggle
                                          (
                new GUIContent
                (
                    text:       "Enable On Startup",
                    tooltip:    "If ticked, Graphy will be displayed by default on startup, otherwise it will initiate and hide."
                ),
                value:          m_enableOnStartup.boolValue
                                          );

            // This is a neat trick to hide Graphy in the Scene if it's going to be deactivated in play mode so that it doesn't use screen space.
            if (!Application.isPlaying)
            {
                m_target.GetComponent <Canvas>().enabled = m_enableOnStartup.boolValue;
            }

            m_keepAlive.boolValue = EditorGUILayout.Toggle
                                    (
                new GUIContent
                (
                    text:       "Keep Alive",
                    tooltip:    "If ticked, it will survive scene changes.\n\nCAREFUL, if you set Graphy as a child of another GameObject, the root GameObject will also survive scene changes. If you want to avoid that put Graphy in the root of the Scene as its own entity."
                ),
                value:          m_keepAlive.boolValue
                                    );

            GUILayout.Space(10);

            EditorGUILayout.BeginHorizontal();

            m_background.boolValue = EditorGUILayout.Toggle
                                     (
                new GUIContent
                (
                    text:       "Background",
                    tooltip:    "If ticked, it will show a background overlay to improve readability in cluttered scenes."
                ),
                value:          m_background.boolValue
                                     );

            m_backgroundColor.colorValue = EditorGUILayout.ColorField(m_backgroundColor.colorValue);

            EditorGUILayout.EndHorizontal();

            GUILayout.Space(10);

            m_enableHotkeys.boolValue = EditorGUILayout.Toggle
                                        (
                new GUIContent
                (
                    text:       "Enable Hotkeys",
                    tooltip:    "If ticked, it will enable the hotkeys to be able to modify Graphy in runtime with custom keyboard shortcuts."
                ),
                value:          m_enableHotkeys.boolValue
                                        );

            if (m_enableHotkeys.boolValue)
            {
                EditorGUILayout.BeginHorizontal();

                EditorGUIUtility.labelWidth = 130;
                EditorGUIUtility.fieldWidth = 35;

                EditorGUILayout.PropertyField
                (
                    m_toggleModeKeyCode,
                    new GUIContent
                    (
                        text:       "Toggle Mode Key",
                        tooltip:    "If ticked, it will require clicking this key and the other ones you have set up."
                    )
                );

                EditorGUIUtility.labelWidth = 30;
                EditorGUIUtility.fieldWidth = 35;

                m_toggleModeCtrl.boolValue = EditorGUILayout.Toggle
                                             (
                    new GUIContent
                    (
                        text:       "Ctrl",
                        tooltip:    "If ticked, it will require clicking Ctrl and the other keys you have set up."
                    ),
                    value:          m_toggleModeCtrl.boolValue
                                             );

                m_toggleModeAlt.boolValue = EditorGUILayout.Toggle
                                            (
                    new GUIContent
                    (
                        text:       "Alt",
                        tooltip:    "If ticked, it will require clicking Alt and the other keys you have set up."
                    ),
                    value:          m_toggleModeAlt.boolValue
                                            );

                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();

                EditorGUIUtility.labelWidth = 130;
                EditorGUIUtility.fieldWidth = 35;

                EditorGUILayout.PropertyField
                (
                    m_toggleActiveKeyCode,
                    new GUIContent
                    (
                        text:       "Toggle Active Key",
                        tooltip:    "If ticked, it will require clicking this key and the other ones you have set up."
                    )
                );

                EditorGUIUtility.labelWidth = 30;
                EditorGUIUtility.fieldWidth = 35;

                m_toggleActiveCtrl.boolValue = EditorGUILayout.Toggle
                                               (
                    new GUIContent
                    (
                        text:       "Ctrl",
                        tooltip:    "If ticked, it will require clicking Ctrl and the other kesy you have set up."
                    ),
                    value:          m_toggleActiveCtrl.boolValue
                                               );

                m_toggleActiveAlt.boolValue = EditorGUILayout.Toggle
                                              (
                    new GUIContent
                    (
                        text:       "Alt",
                        tooltip:    "If ticked, it will require clicking Alt and the other keys you have set up."
                    ),
                    value:          m_toggleActiveAlt.boolValue
                                              );

                EditorGUILayout.EndHorizontal();
            }

            GUILayout.Space(15);

            EditorGUIUtility.labelWidth = 155;
            EditorGUIUtility.fieldWidth = 35;

            EditorGUILayout.PropertyField
            (
                m_graphModulePosition,
                new GUIContent
                (
                    text:       "Graph modules position",
                    tooltip:    "Defines in which corner the modules will be located."
                )
            );

            #endregion

            GUILayout.Space(20);

            #region Section -> FPS

            m_fpsModuleInspectorToggle = EditorGUILayout.Foldout
                                         (
                m_fpsModuleInspectorToggle,
                content:    " [ FPS ]",
                style:      foldoutStyle
                                         );

            GUILayout.Space(5);

            if (m_fpsModuleInspectorToggle)
            {
                EditorGUILayout.PropertyField
                (
                    m_fpsModuleState,
                    new GUIContent
                    (
                        text:       "Module state",
                        tooltip:    "FULL -> Text + Graph \nTEXT -> Just text \nOFF -> Turned off"
                    )
                );

                GUILayout.Space(5);

                EditorGUILayout.LabelField("Fps thresholds and colors:");

                EditorGUI.indentLevel++;

                EditorGUILayout.BeginHorizontal();

                m_goodFpsThreshold.intValue = EditorGUILayout.IntField
                                              (
                    new GUIContent
                    (
                        text:       "- Good",
                        tooltip:    "When FPS rise above this value, this color will be used."
                    ),
                    value:          m_goodFpsThreshold.intValue
                                              );

                m_goodFpsColor.colorValue = EditorGUILayout.ColorField(m_goodFpsColor.colorValue);

                EditorGUILayout.EndHorizontal();

                if (m_goodFpsThreshold.intValue <= m_cautionFpsThreshold.intValue && m_goodFpsThreshold.intValue > 1)
                {
                    m_cautionFpsThreshold.intValue = m_goodFpsThreshold.intValue - 1;
                }
                else if (m_goodFpsThreshold.intValue <= 1)
                {
                    m_goodFpsThreshold.intValue = 2;
                }

                EditorGUILayout.BeginHorizontal();

                m_cautionFpsThreshold.intValue = EditorGUILayout.IntField
                                                 (
                    new GUIContent
                    (
                        text:       "- Caution",
                        tooltip:    "When FPS falls between this and the Good value, this color will be used."
                    ),
                    value:          m_cautionFpsThreshold.intValue
                                                 );

                m_cautionFpsColor.colorValue = EditorGUILayout.ColorField(m_cautionFpsColor.colorValue);

                EditorGUILayout.EndHorizontal();

                if (m_cautionFpsThreshold.intValue >= m_goodFpsThreshold.intValue)
                {
                    m_cautionFpsThreshold.intValue = m_goodFpsThreshold.intValue - 1;
                }
                else if (m_cautionFpsThreshold.intValue <= 0)
                {
                    m_cautionFpsThreshold.intValue = 1;
                }

                EditorGUILayout.BeginHorizontal();

                EditorGUILayout.IntField
                (
                    new GUIContent
                    (
                        text:       "- Critical",
                        tooltip:    "When FPS falls below the Caution value, this color will be used. (You can't have negative FPS, so this value is just for reference, it can't be changed)."
                    ),
                    value:          0
                );

                m_criticalFpsColor.colorValue = EditorGUILayout.ColorField(m_criticalFpsColor.colorValue);

                EditorGUILayout.EndHorizontal();

                EditorGUI.indentLevel--;

                if (m_fpsModuleState.intValue == 0)
                {
                    m_fpsGraphResolution.intValue = EditorGUILayout.IntSlider
                                                    (
                        new GUIContent
                        (
                            text:       "Graph resolution",
                            tooltip:    "Defines the amount of points in the graph"
                        ),
                        m_fpsGraphResolution.intValue,
                        leftValue:      20,
                        rightValue:     m_graphyMode.intValue == 0 ? 300 : 128
                                                    );
                }

                EditorGUIUtility.labelWidth = 180;
                EditorGUIUtility.fieldWidth = 35;

                m_timeToResetMinMaxFps.intValue = EditorGUILayout.IntSlider
                                                  (
                    new GUIContent
                    (
                        text:       "Time to reset min/max values",
                        tooltip:    "If the min/max value doesn't change in the specified time, they will be reset. This allows tracking the min/max fps in a shorter interval. \n\nSet it to 0 if you don't want it to reset."
                    ),
                    m_timeToResetMinMaxFps.intValue,
                    leftValue:      0,
                    rightValue:     120
                                                  );

                EditorGUIUtility.labelWidth = 155;
                EditorGUIUtility.fieldWidth = 35;

                m_fpsTextUpdateRate.intValue = EditorGUILayout.IntSlider
                                               (
                    new GUIContent
                    (
                        text:       "Text update rate",
                        tooltip:    "Defines the amount times the text is updated in 1 second."
                    ),
                    m_fpsTextUpdateRate.intValue,
                    leftValue:      1,
                    rightValue:     60
                                               );
            }

            #endregion

            GUILayout.Space(20);

            #region Section -> RTT

            m_rttModuleInspectorToggle = EditorGUILayout.Foldout
                                         (
                m_rttModuleInspectorToggle,
                content: " [ RTT ]",
                style: foldoutStyle
                                         );

            GUILayout.Space(5);

            if (m_rttModuleInspectorToggle)
            {
                EditorGUILayout.PropertyField
                (
                    m_rttModuleState,
                    new GUIContent
                    (
                        text: "Module state",
                        tooltip: "FULL -> Text + Graph \nTEXT -> Just text \nOFF -> Turned off"
                    )
                );

                GUILayout.Space(5);

                EditorGUILayout.LabelField("Rtt thresholds and colors:");

                EditorGUI.indentLevel++;

                EditorGUILayout.BeginHorizontal();

                m_goodRttThreshold.intValue = EditorGUILayout.IntField
                                              (
                    new GUIContent
                    (
                        text: "- Good",
                        tooltip: "When RTT rise above this value, this color will be used."
                    ),
                    value: m_goodRttThreshold.intValue
                                              );

                m_goodRttColor.colorValue = EditorGUILayout.ColorField(m_goodRttColor.colorValue);

                EditorGUILayout.EndHorizontal();

                if (m_goodRttThreshold.intValue <= m_cautionRttThreshold.intValue && m_goodRttThreshold.intValue > 1)
                {
                    m_cautionRttThreshold.intValue = m_goodRttThreshold.intValue - 1;
                }
                else if (m_goodRttThreshold.intValue <= 1)
                {
                    m_goodRttThreshold.intValue = 2;
                }

                EditorGUILayout.BeginHorizontal();

                m_cautionRttThreshold.intValue = EditorGUILayout.IntField
                                                 (
                    new GUIContent
                    (
                        text: "- Caution",
                        tooltip: "When RTT falls between this and the Good value, this color will be used."
                    ),
                    value: m_cautionRttThreshold.intValue
                                                 );

                m_cautionRttColor.colorValue = EditorGUILayout.ColorField(m_cautionRttColor.colorValue);

                EditorGUILayout.EndHorizontal();

                if (m_cautionRttThreshold.intValue >= m_goodRttThreshold.intValue)
                {
                    m_cautionRttThreshold.intValue = m_goodRttThreshold.intValue - 1;
                }
                else if (m_cautionRttThreshold.intValue <= 0)
                {
                    m_cautionRttThreshold.intValue = 1;
                }

                EditorGUILayout.BeginHorizontal();

                EditorGUILayout.IntField
                (
                    new GUIContent
                    (
                        text: "- Critical",
                        tooltip: "When RTT falls below the Caution value, this color will be used. (You can't have negative RTT, so this value is just for reference, it can't be changed)."
                    ),
                    value: 0
                );

                m_criticalRttColor.colorValue = EditorGUILayout.ColorField(m_criticalRttColor.colorValue);

                EditorGUILayout.EndHorizontal();

                EditorGUI.indentLevel--;

                if (m_rttModuleState.intValue == 0)
                {
                    m_rttGraphResolution.intValue = EditorGUILayout.IntSlider
                                                    (
                        new GUIContent
                        (
                            text: "Graph resolution",
                            tooltip: "Defines the amount of points in the graph"
                        ),
                        m_rttGraphResolution.intValue,
                        leftValue: 20,
                        rightValue: m_graphyMode.intValue == 0 ? 300 : 128
                                                    );
                }

                EditorGUIUtility.labelWidth = 180;
                EditorGUIUtility.fieldWidth = 35;

                m_timeToResetMinMaxRtt.intValue = EditorGUILayout.IntSlider
                                                  (
                    new GUIContent
                    (
                        text: "Time to reset min/max values",
                        tooltip: "If the min/max value doesn't change in the specified time, they will be reset. This allows tracking the min/max rtt in a shorter interval. \n\nSet it to 0 if you don't want it to reset."
                    ),
                    m_timeToResetMinMaxRtt.intValue,
                    leftValue: 0,
                    rightValue: 120
                                                  );

                EditorGUIUtility.labelWidth = 155;
                EditorGUIUtility.fieldWidth = 35;

                m_rttTextUpdateRate.intValue = EditorGUILayout.IntSlider
                                               (
                    new GUIContent
                    (
                        text: "Text update rate",
                        tooltip: "Defines the amount times the text is updated in 1 second."
                    ),
                    m_rttTextUpdateRate.intValue,
                    leftValue: 1,
                    rightValue: 60
                                               );
            }

            #endregion

            GUILayout.Space(20);

            #region Section -> Advanced Settings

            m_advancedModuleInspectorToggle = EditorGUILayout.Foldout
                                              (
                m_advancedModuleInspectorToggle,
                content:    " [ ADVANCED DATA ]",
                style:      foldoutStyle
                                              );

            GUILayout.Space(5);

            if (m_advancedModuleInspectorToggle)
            {
                EditorGUILayout.PropertyField(m_advancedModulePosition);

                EditorGUILayout.PropertyField
                (
                    m_advancedModuleState,
                    new GUIContent
                    (
                        text:       "Module state",
                        tooltip:    "FULL -> Text \nOFF -> Turned off"
                    )
                );
            }

            #endregion ;

            EditorGUIUtility.labelWidth = defaultLabelWidth;
            EditorGUIUtility.fieldWidth = defaultFieldWidth;

            serializedObject.ApplyModifiedProperties();
        }