docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MediaContentDrawer

    Property Drawer for MediaContent properties

    Inheritance
    object
    GUIDrawer
    PropertyDrawer
    MediaContentDrawer
    Inherited Members
    PropertyDrawer.CanCacheInspectorGUI(SerializedProperty)
    PropertyDrawer.attribute
    PropertyDrawer.fieldInfo
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Tutorials.Core.Editor
    Assembly: Unity.Tutorials.Core.Editor.dll
    Syntax
    [CustomPropertyDrawer(typeof(MediaContent))]
    public class MediaContentDrawer : PropertyDrawer

    Methods

    CreatePropertyGUI(SerializedProperty)

    Create the UIElement for the given SerializedProperty

    Declaration
    public override VisualElement CreatePropertyGUI(SerializedProperty property)
    Parameters
    Type Name Description
    SerializedProperty property

    The SerializedProperty for which to create the elements

    Returns
    Type Description
    VisualElement

    The root of the UIElements hierarchy created

    Overrides
    PropertyDrawer.CreatePropertyGUI(SerializedProperty)

    GetPropertyHeight(SerializedProperty, GUIContent)

    Return the height the property will fill in the UI (used by the OnGUI version)

    Declaration
    public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
    Parameters
    Type Name Description
    SerializedProperty property

    The SerializedProperty for which to return the height

    GUIContent label

    The label appearing before the property controls

    Returns
    Type Description
    float

    The height in pixel this drawer needs to draw the controls

    Overrides
    PropertyDrawer.GetPropertyHeight(SerializedProperty, GUIContent)

    OnGUI(Rect, SerializedProperty, GUIContent)

    IMGUI version of the drawer, called when the given SerializedProperty is part of IMGUI code

    Declaration
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    Parameters
    Type Name Description
    Rect position

    The Rect in which to draw the property

    SerializedProperty property

    The SerializedProperty for which to draw controls

    GUIContent label

    The label before the property

    Overrides
    PropertyDrawer.OnGUI(Rect, SerializedProperty, GUIContent)
    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)