docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class InspectorTestUtility

    Utility class to create an Inspector for a given object.

    Inheritance
    object
    InspectorTestUtility
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.UIElements.TestFramework
    Assembly: Unity.UI.TestFramework.Editor.dll
    Syntax
    public static class InspectorTestUtility

    Methods

    CreateDebugInspector(Object)

    Creates an InspectorElement for the given object using the default generic inspector, ignoring any registered custom Editors.

    Declaration
    public static InspectorElement CreateDebugInspector(Object obj)
    Parameters
    Type Name Description
    Object obj

    The Object for which to create an InspectorElement.

    Returns
    Type Description
    InspectorElement

    The InspectorElement that is inspecting the provided Object.

    CreateInspector(Object)

    Creates an InspectorElement for the given object using the registered CustomEditor for the object.

    Declaration
    public static InspectorElement CreateInspector(Object obj)
    Parameters
    Type Name Description
    Object obj

    The Object for which to create an InspectorElement.

    Returns
    Type Description
    InspectorElement

    The InspectorElement that is inspecting the provided Object.

    GetEditor(InspectorElement)

    Returns the Editor object created to inspect the given object.

    Declaration
    public static Editor GetEditor(this InspectorElement inspector)
    Parameters
    Type Name Description
    InspectorElement inspector

    InspectorElement for which to find the Editor object.

    Returns
    Type Description
    Editor

    The Editor object that the InspectorElement is inspecting.

    GetInspectorContent(InspectorElement)

    Returns the VisualElement created by the Editor to display the object's properties. IMGUI-only inspectors return an IMGUIContainer.

    Declaration
    public static VisualElement GetInspectorContent(this InspectorElement inspector)
    Parameters
    Type Name Description
    InspectorElement inspector

    InspectorElement for which to obtain the VisualElement content.

    Returns
    Type Description
    VisualElement

    The VisualElement containing the InspectorElement content.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)