Class MediaContentDrawer
Property Drawer for MediaContent properties
Inherited Members
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 |
---|---|---|
Serialized |
property | The SerializedProperty for which to create the elements |
Returns
Type | Description |
---|---|
Visual |
The root of the UIElements hierarchy created |
Overrides
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 |
---|---|---|
Serialized |
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
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 |
Serialized |
property | The SerializedProperty for which to draw controls |
GUIContent | label | The label before the property |