Version: Unity 6 (6000.0)
LanguageEnglish
  • C#

IRenderPipelineGraphicsSettingsContextMenu<T0>

interface in UnityEditor.Rendering


Implements interfaces:IRenderPipelineGraphicsSettingsContextMenu

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Allows to modify the contextual menu of IRenderPipelineGraphicsSettings in the inspector.

using UnityEditor;
using UnityEditor.Rendering;
using UnityEngine.UIElements;

struct DummyAMenu : IRenderPipelineGraphicsSettingsContextMenu<DummyA> { public int priority => 0;

static void Increment(DummyA a) => a.myInt++;

public void PopulateContextMenu(DummyA setting, PropertyDrawer _, ref GenericDropdownMenu menu) { if (!EditorApplication.isPlaying) menu.AddItem("Try Increment", false, () => Increment(setting)); else menu.AddDisabledItem("Try Increment", false); } }

Public Methods

PopulateContextMenuAllows to populate context menu with custom methods for your IRenderPipelineGraphicsSettings.