# EditorGUI.MixedValueScope

> Creates a group of controls that can visually represent a mixed value.

## Definition

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

```csharp
public struct EditorGUI.MixedValueScope : IDisposable
```

## Remarks

To configure a group of controls that can show a dash (-) if selected objects have different values, add `EditorGUI.MixedValueScope` before the group and set `newMixedValue` to true.

```csharp
using UnityEditor;
using UnityEngine;

[CanEditMultipleObjects]
[CustomEditor(typeof(MixedValueComponentTest))]
public class MixedValueComponentTestEditor : Editor
{
    public override void OnInspectorGUI()
    {
        SerializedProperty serializedPropertyMyInt = serializedObject.FindProperty("MyInt");
        using (new EditorGUI.MixedValueScope(serializedPropertyMyInt.hasMultipleDifferentValues))
        {
            EditorGUI.BeginChangeCheck();
            int newValue = EditorGUILayout.IntField("My Int", serializedPropertyMyInt.intValue);
            if (EditorGUI.EndChangeCheck())
                serializedPropertyMyInt.intValue = newValue;
        }
        serializedObject.ApplyModifiedProperties();
    }
}

public class MixedValueComponentTest : MonoBehaviour
{
    public int MyInt;
}
```

Additional Resources: [EditorGUI.showMixedValue](/engine/6000.3/script-reference/unityeditor/editorgui/showmixedvalue.md).

## Constructors

| Constructor                                                                                                      | Description                                                                                                                                                                         |
| ---------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [MixedValueScope(System.Boolean)](/engine/6000.3/script-reference/unityeditor/editorgui/mixedvaluescope/ctor.md) | Creates a new [EditorGUI.MixedValueScope](/engine/6000.3/script-reference/unityeditor/editorgui/mixedvaluescope.md) that determines the start of the group of mixed value controls. |
