# EditorGUILayout.FadeGroupScope

> Begins a group that can be be hidden/shown and the transition will be animated.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor
* **Inherits from:** Scope
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class EditorGUILayout.FadeGroupScope : GUI.Scope, IDisposable
```

## Examples

```csharp
using UnityEngine;
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEngine.Events;

public class MyWindow : EditorWindow
{
    AnimBool m_ShowExtraFields;
    string m_String;
    Color m_Color = Color.white;
    int m_Number = 0;

    [MenuItem("Window/My Window")]
    static void Init()
    {
        MyWindow window = (MyWindow)EditorWindow.GetWindow(typeof(MyWindow));
        window.Show();
    }

    void OnEnable()
    {
        m_ShowExtraFields = new AnimBool(true);
        m_ShowExtraFields.valueChanged.AddListener(new UnityAction(base.Repaint));
    }

    void OnGUI()
    {
        m_ShowExtraFields.target = EditorGUILayout.ToggleLeft("Show extra fields", m_ShowExtraFields.target);

        //Extra block that can be toggled on and off.
        using (var group = new EditorGUILayout.FadeGroupScope(m_ShowExtraFields.faded))
        {
            if (group.visible)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.PrefixLabel("Color");
                m_Color = EditorGUILayout.ColorField(m_Color);
                EditorGUILayout.PrefixLabel("Text");
                m_String = EditorGUILayout.TextField(m_String);
                EditorGUILayout.PrefixLabel("Number");
                m_Number = EditorGUILayout.IntSlider(m_Number, 0, 10);
                EditorGUI.indentLevel--;
            }
        }
    }
}
```

## Constructors

| Constructor                                                                                                         | Description                                                    |
| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [FadeGroupScope(System.Single)](/engine/6000.0/script-reference/unityeditor/editorguilayout/fadegroupscope/ctor.md) | Create a new FadeGroupScope and begin the corresponding group. |

## Properties

| Property                                                                                         | Description                   |
| ------------------------------------------------------------------------------------------------ | ----------------------------- |
| [visible](/engine/6000.0/script-reference/unityeditor/editorguilayout/fadegroupscope/visible.md) | Whether the group is visible. |
