Unity-Technologies/UnityCsReference · error · ArgumentException

IRenderPipelineGraphicsSettings is not assignable from rende

Error message

IRenderPipelineGraphicsSettings is not assignable from renderPipelineGraphicsSettingsType

What it means

The generic OpenAndScrollTo<T>(Type renderPipelineGraphicsSettingsType) requires the type to implement IRenderPipelineGraphicsSettings; if typeof(IRenderPipelineGraphicsSettings).IsAssignableFrom(type) is false, it throws ArgumentException because it cannot search for a tab by that type.

Source

Thrown at Editor/Mono/Inspector/GraphicsSettingsInspectors/GraphicsSettingsInspectorUtility.cs:405

        {
            OpenAndScrollTo(typeof(TGraphicsSettings), subElementFunc);
        }

        /// <summary>
        /// Open the Graphics Settings window and scroll to the specified Render Pipeline Graphics Settings type.
        /// </summary>
        /// <param name="renderPipelineGraphicsSettingsType">Type of the IRenderPipelineGraphicsSettings to search for.</param>
        /// <param name="subElementFunc">Provide a Func to search for sub element in the IRenderPipelineGraphicsSettings drawer.</param>
        /// <typeparam name="TVisualElement">Type of the VisualElement to searcg for.</typeparam>
        /// <exception cref="ArgumentNullException">Throw if a renderPipelineGraphicsSettingsType is null.</exception>
        /// <exception cref="ArgumentException">Throw if a renderPipelineGraphicsSettingsType type is not derived from IRenderPipelineGraphicsSettings.</exception>
        internal static void OpenAndScrollTo<TVisualElement>(Type renderPipelineGraphicsSettingsType, Func<TVisualElement, bool> subElementFunc = null)
            where TVisualElement : VisualElement
        {
            if (renderPipelineGraphicsSettingsType == null)
                throw new ArgumentNullException(nameof(renderPipelineGraphicsSettingsType));
            if (!typeof(IRenderPipelineGraphicsSettings).IsAssignableFrom(renderPipelineGraphicsSettingsType))
                throw new ArgumentException($"{nameof(IRenderPipelineGraphicsSettings)} is not assignable from {nameof(renderPipelineGraphicsSettingsType)}");

            OpenAndScrollTo(
                root => TryFindTabByType(renderPipelineGraphicsSettingsType, root, out var tabbedView, out var tabButton, out var bindingPath)
                    ? (true, tabbedView, tabButton, bindingPath)
                    : (false, tabbedView, null, null),
                () => $"Couldn't find a tab for {renderPipelineGraphicsSettingsType.Name} type in the settings container.",
                SearchForVisualElementInTabsAndScroll,
                subElementFunc);
        }

        /// <summary>
        /// Open the Graphics Settings window and scroll to the field specified by the set of methods.
        /// </summary>
        /// <param name="searchForVisualElement">Search for a visual element that corresponds to the propertyPath or IRenderPipelineGraphicsSettings type.</param>
        /// <param name="message">Message to log if the visual element wasn't found. It will also return tabbed view if exists and tab button if it contains a visual element.</param>
        /// <param name="execute">Execute the method to scroll to the visual element.</param>
        /// <param name="subElementFunc">Provide a Func to search for sub element in the IRenderPipelineGraphicsSettings drawer.</param>
        /// <typeparam name="TVisualElement">Type of the VisualElement to search for.</typeparam>

View on GitHub (pinned to 225b0fbdb5)

Solutions

  1. Pass only types that implement IRenderPipelineGraphicsSettings.
  2. Guard with typeof(IRenderPipelineGraphicsSettings).IsAssignableFrom(type) before calling.
  3. Resolve the correct settings type from your render pipeline's graphics settings collection.

Example fix

// before
OpenAndScrollTo<MyField>(typeof(SomeNonSettingsType)); // throws

// after
if (typeof(IRenderPipelineGraphicsSettings).IsAssignableFrom(type))
    OpenAndScrollTo<PropertyField>(type);
Defensive patterns

Strategy: type-guard

Validate before calling

if (renderPipelineGraphicsSettingsType == null)
    throw new ArgumentNullException(nameof(renderPipelineGraphicsSettingsType));
if (!typeof(IRenderPipelineGraphicsSettings).IsAssignableFrom(renderPipelineGraphicsSettingsType))
    throw new ArgumentException("Type must implement IRenderPipelineGraphicsSettings.");
GraphicsSettingsInspectorUtility.OpenAndScrollTo<PropertyField>(renderPipelineGraphicsSettingsType);

Type guard

static bool IsGraphicsSettingsType(Type t) =>
    t != null && typeof(IRenderPipelineGraphicsSettings).IsAssignableFrom(t);

Prevention

When it happens

Trigger: Passing a Type that does not implement IRenderPipelineGraphicsSettings — e.g. a plain data class, a ScriptableObject, or a render-pipeline asset type that isn't a graphics-settings type.

Common situations: Confusing a render pipeline asset type with a graphics-settings type. Reflecting over types and passing any type found. Version changes where a type moved out of the graphics-settings interface.

Related errors


AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13). Data as JSON: /api/errors/41cc9c96d8705e19. Report an issue: GitHub.