# IRenderPipelineGraphicsSettingsContextMenu2<T>

> Interface for modifying the contextual menu of a IRenderPipelineGraphicsSettings in the Inspector.

## Definition

* **Type:** Interface
* **Namespace:** [UnityEditor.Rendering](/engine/6000.7/script-reference/unityeditor/rendering.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public interface IRenderPipelineGraphicsSettingsContextMenu2<T> : IRenderPipelineGraphicsSettingsContextMenu2 where T : class, IRenderPipelineGraphicsSettings
```

## Remarks

Use this interface to add your own custom commands in the contextual menu of a [IRenderPipelineGraphicsSettings](/engine/6000.7/script-reference/unityengine/rendering/irenderpipelinegraphicssettings.md). The type of the [IRenderPipelineGraphicsSettings](/engine/6000.7/script-reference/unityengine/rendering/irenderpipelinegraphicssettings.md) affected is given by the generic argument. The menu added here will appears in the matching contextual menu in **Edit** > **Project Settings** > **Graphics**.

## Examples

```csharp
using UnityEditor;
using UnityEditor.Rendering;
using UnityEngine.UIElements;

struct DummyAMenu : IRenderPipelineGraphicsSettingsContextMenu2<DummyA>
{
    // The lower the priority, the higher the added command appears in the menu
    public int priority => 0;

    public void PopulateContextMenu(DummyA setting, SerializedProperty _, ref GenericMenu menu)
    {
        // Add specific commands that appear when you select the contextual menu button 
        // of a DummyA in **Edit** > **Project Settings** > **Graphics**. It will not appear for other types.
        menu.AddItem("Log type", false, () => Debug.Log(settings.GetType()));

        // As modifications are not recommended at runtime, check
        // EditorApplication.isPlaying before modifying any data.
        if (EditorApplication.isPlaying)
            menu.AddDisabledItem("Custom Reset", false);
        else
            menu.AddItem("Custom Reset", false, () =>settings.Reset());
    }
}
```

## Methods

| Method                                                                                                                                           | Description                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [PopulateContextMenu](/engine/6000.7/script-reference/unityeditor/rendering/irenderpipelinegraphicssettingscontextmenu21/populatecontextmenu.md) | Populate a context menu with custom methods for your [IRenderPipelineGraphicsSettings](/engine/6000.7/script-reference/unityengine/rendering/irenderpipelinegraphicssettings.md). |

## Inheritance

**Inherited Members:**

* [IRenderPipelineGraphicsSettingsContextMenu2.PopulateContextMenu(IRenderPipelineGraphicsSettings, SerializedProperty, GenericMenu)](/engine/6000.7/script-reference/unityeditor/rendering/irenderpipelinegraphicssettingscontextmenu2/populatecontextmenu.md)
* [IRenderPipelineGraphicsSettingsContextMenu2.priority](/engine/6000.7/script-reference/unityeditor/rendering/irenderpipelinegraphicssettingscontextmenu2/priority.md)
